Fix display of next rotation time (#3236)

pull/3238/head
Jeff Mitchell 3 years ago
parent 5716a30813
commit 6f4f51cc9f

@ -155,6 +155,9 @@ func (w *Worker) startAuthRotationTicking(cancelCtx context.Context) {
// halfway through the current rotation interval
now := time.Now().UTC()
nextRotation := lastRotation.Add(rotationInterval / 2)
if lastRotation.IsZero() {
nextRotation = now
}
event.WriteSysEvent(cancelCtx, op, "checking if worker auth should rotate", append(
args,
"now", now.Format(time.RFC3339),
@ -176,7 +179,7 @@ func (w *Worker) startAuthRotationTicking(cancelCtx context.Context) {
event.WriteError(cancelCtx, op, err)
continue
}
lastRotation := now
lastRotation = now
nextRotation = lastRotation.Add(newRotationInterval / 2)
resetDuration = nextRotation.Sub(now)
event.WriteSysEvent(cancelCtx, op, "worker credentials rotated", "next_rotation", nextRotation)

Loading…
Cancel
Save