[TrueCloudLab#13] pool: Renew token before it expired #14
1 changed files with 2 additions and 1 deletions
|
@ -67,5 +67,6 @@ func (c *sessionCache) updateEpoch(newEpoch uint64) {
|
||||||
|
|
||||||
func (c *sessionCache) expired(val *cacheValue) bool {
|
func (c *sessionCache) expired(val *cacheValue) bool {
|
||||||
epoch := atomic.LoadUint64(&c.currentEpoch)
|
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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue