mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 18:37:05 +00:00
fix / lifetime.Time not updated on expiration shift
Former-commit-id: 03cd1e8dcf20d6e68b70667d1f808860cb027d32
This commit is contained in:
@@ -43,6 +43,7 @@ func (lt *LifeTime) Revive(onExpire func()) {
|
|||||||
// Shift resets the lifetime based on "d".
|
// Shift resets the lifetime based on "d".
|
||||||
func (lt *LifeTime) Shift(d time.Duration) {
|
func (lt *LifeTime) Shift(d time.Duration) {
|
||||||
if d > 0 && lt.timer != nil {
|
if d > 0 && lt.timer != nil {
|
||||||
|
lt.Time = time.Now().Add(d)
|
||||||
lt.timer.Reset(d)
|
lt.timer.Reset(d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user