Skip to content

Commit

Permalink
[sshkeys] reset expiration timer when it was triggered (#48794)
Browse files Browse the repository at this point in the history
This PR resets the expiration timer when it was triggered to ensure it will always fire after a certain amount of time.

Signed-off-by: Tiago Silva <[email protected]>
  • Loading branch information
tigrato authored Nov 13, 2024
1 parent 197ba06 commit ebae02c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/secretsscanner/authorizedkeys/authorized_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,14 @@ func (w *Watcher) start(ctx context.Context) error {
expirationTimerInterval = maxInitialDelay
}

// reset the mandatory report flag.
requiresReportToExtendTTL = false

// If the keys were reported, reset the expiration timer.
if keysReported {
if keysReported || requiresReportToExtendTTL {
resetTimer(expirationTimer, expirationTimerInterval)
}

// reset the mandatory report flag.
requiresReportToExtendTTL = false

resetTimer(monitorTimer, monitorTimerInterval)

select {
Expand Down

0 comments on commit ebae02c

Please sign in to comment.