gf/os/gcache/gcache_adapter_memory_item.go

20 lines
581 B
Go
Raw Normal View History

2021-01-17 21:46:25 +08:00
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package gcache
import (
2021-10-11 21:41:56 +08:00
"github.com/gogf/gf/v2/os/gtime"
)
2021-08-27 00:01:15 +08:00
// IsExpired checks whether `item` is expired.
2020-09-26 20:47:29 +08:00
func (item *adapterMemoryItem) IsExpired() bool {
2019-06-19 09:06:52 +08:00
// Note that it should use greater than or equal judgement here
// imagining that the cache time is only 1 millisecond.
2021-11-15 20:26:31 +08:00
return item.e < gtime.TimestampMilli()
2019-06-19 09:06:52 +08:00
}