gf/g/os/gcache/gcache_mem_cache_item.go

18 lines
584 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Copyright 2018 gf Author(https://gitee.com/johng/gf). 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://gitee.com/johng/gf.
package gcache
import "gitee.com/johng/gf/g/os/gtime"
// 判断缓存项是否已过期
func (item *memCacheItem) IsExpired() bool {
// 注意这里应当包含等于试想一下缓存时间只有最小粒度为1毫秒的情况
if item.e >= gtime.Millisecond() {
return false
}
return true
}