[TrueCloudLab#13] pool: Renew token before it expired
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>remotes/1719900476480179218/tmp_refs/heads/KirillovDenis/poc/impersonate
parent
cf9a54dcda
commit
cf64ddfb14
|
@ -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 New Issue