File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -272,9 +272,10 @@ func (e *entraidTokenManager) durationToRenewal(t *token.Token) time.Duration {
272
272
// e.expirationRefreshRatio = 0.001
273
273
// - with int math and 100 precision: 10000 * (0.001*100) = 0ms
274
274
// - with int math and 10000 precision: 10000 * (0.001*10000) = 100ms
275
+ precision := int64 (10000 )
275
276
ttlMillis := t .TTL () // Already in milliseconds
276
- refreshRationInt := int64 (e .expirationRefreshRatio * 10000 )
277
- refreshMillis := ttlMillis * refreshRationInt / 10000
277
+ refreshRatioInt := int64 (e .expirationRefreshRatio * float64 ( precision ) )
278
+ refreshMillis := ttlMillis * refreshRatioInt / precision
278
279
refreshTimeMillis := t .ReceivedAt ().UnixMilli () + refreshMillis
279
280
280
281
// Calculate time until refresh
You can’t perform that action at this time.
0 commit comments