github.com/gogf/gf@v1.16.9/os/gcache/gcache_adapter_memory_item.go (about)

     1  // Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/gogf/gf.
     6  
     7  package gcache
     8  
     9  import (
    10  	"github.com/gogf/gf/os/gtime"
    11  )
    12  
    13  // IsExpired checks whether `item` is expired.
    14  func (item *adapterMemoryItem) IsExpired() bool {
    15  	// Note that it should use greater than or equal judgement here
    16  	// imagining that the cache time is only 1 millisecond.
    17  	if item.e >= gtime.TimestampMilli() {
    18  		return false
    19  	}
    20  	return true
    21  }