2021-01-17 21:46:25 +08:00
|
|
|
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
|
2018-08-30 00:00:15 +08:00
|
|
|
//
|
|
|
|
// 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,
|
2019-02-02 16:18:25 +08:00
|
|
|
// You can obtain one at https://github.com/gogf/gf.
|
2018-08-30 00:00:15 +08:00
|
|
|
|
|
|
|
package gcache
|
|
|
|
|
2019-08-13 20:15:09 +08:00
|
|
|
import (
|
2021-10-11 21:41:56 +08:00
|
|
|
"github.com/gogf/gf/v2/os/gtime"
|
2019-08-13 20:15:09 +08:00
|
|
|
)
|
2018-08-30 00:00:15 +08:00
|
|
|
|
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
|
|
|
}
|