diff --git a/pool/cache.go b/pool/cache.go index b051e5f2..a50da22f 100644 --- a/pool/cache.go +++ b/pool/cache.go @@ -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) }