1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 18:07:01 +00:00

fix / lifetime.Time not updated on expiration shift

Former-commit-id: 03cd1e8dcf20d6e68b70667d1f808860cb027d32
This commit is contained in:
Akira Ho
2018-08-15 14:21:22 +08:00
parent f6436f2af4
commit 768dd76b62

View File

@@ -43,6 +43,7 @@ func (lt *LifeTime) Revive(onExpire func()) {
// Shift resets the lifetime based on "d".
func (lt *LifeTime) Shift(d time.Duration) {
if d > 0 && lt.timer != nil {
lt.Time = time.Now().Add(d)
lt.timer.Reset(d)
}
}