File tree Expand file tree Collapse file tree 2 files changed +464
-4
lines changed Expand file tree Collapse file tree 2 files changed +464
-4
lines changed Original file line number Diff line number Diff line change @@ -288,12 +288,12 @@ func (e *entraidTokenManager) durationToRenewal(t *token.Token) time.Duration {
288
288
return 0
289
289
}
290
290
291
- // Subtract lower bound from time till expiration
292
- timeTillExpiration = timeTillExpiration - lowerBoundMillis
291
+ // Calculate time until lower bound
292
+ timeUntilLowerBound : = timeTillExpiration - lowerBoundMillis
293
293
294
294
// If refresh would occur after lower bound, use time until lower bound
295
- if timeTillExpiration < timeUntilRefresh {
296
- return time .Duration (timeTillExpiration ) * time .Millisecond
295
+ if timeUntilRefresh > timeUntilLowerBound {
296
+ return time .Duration (timeUntilLowerBound ) * time .Millisecond
297
297
}
298
298
299
299
// Otherwise use time until refresh
You can’t perform that action at this time.
0 commit comments