Fix display of next rotation time (#3236)
This commit is contained in:
1 parent
5716a30813
commit
6f4f51cc9f
1 file changed
+4
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user