[TrueCloudLab#13] pool: Renew token before it expired #14

Merged
KirillovDenis merged 1 commit from feature/fix_token_cache_expiration-frostfs into master 2023-01-30 12:06:03 +00:00

View file

@ -67,5 +67,6 @@ func (c *sessionCache) updateEpoch(newEpoch uint64) {
func (c *sessionCache) expired(val *cacheValue) bool {
epoch := atomic.LoadUint64(&c.currentEpoch)
return val.token.ExpiredAt(epoch)
// use epoch+1 (clear cache beforehand) to prevent 'expired session token' error right after epoch tick
return val.token.ExpiredAt(epoch + 1)
}