I hope to provide a method: get the value but not update the expiration time
sirodeneko opened this issue · comments
siro zou commented
I hope to provide a method: get the value but not update the expiration time
siro zou commented
If you are busy, I can do it。
HansenH commented
Same. go-cache can get a value without updating the exp time, but it cannot be set to update after each access. I need the two features both.
Daniel Steininger commented
Hello all. I also need the function that the value is forced to be deleted after timeout.
func (table *CacheTable) Add(key interface{}, lifeSpan time.Duration, data interface{}) *CacheItem {
func (table *CacheTable) AddWithTTL(key interface{}, ttl time.Duration, data interface{}) *CacheItem {
Daniel Steininger commented
Ok, for the first time we can flush the complete cache. => as a work-a-round
var internalCache *cache2go.CacheTable
func init() {
internalCache = cache2go.Cache("internalCache")
go func() {
for {
time.Sleep(1 * time.Minute)
internalCache.Flush()
}
}()
}
Christian Muehlhaeuser commented
@sirodeneko @dreamblack86 Happy to review a PR for this!