update worker auth rotate (#2484)

This commit is contained in:
Irena Rindos authored and GitHub committed 2022-09-22 13:13:31 -04:00
1 parent f6532c6cd6
commit bd4f5f3801
1 file changed
+2 -1
+2 -1
View File
@@ -93,7 +93,7 @@ func (w *Worker) startAuthRotationTicking(cancelCtx context.Context) {
shouldRotate = true
default:
delta := latestValid.Sub(earliestValid)
shouldRotate = now.Before(earliestValid.Add(delta / 2))
shouldRotate = now.After(earliestValid.Add(delta / 2))
}
if !shouldRotate {
@@ -104,6 +104,7 @@ func (w *Worker) startAuthRotationTicking(cancelCtx context.Context) {
event.WriteError(cancelCtx, op, err)
continue
}
event.WriteSysEvent(cancelCtx, op, "worker credentials rotated")
// TODO (maybe): Calculate new delta and set a custom retry time on the timer?
}