add timeout description for file and memory cache.
This commit is contained in:
3
cache/memory.go
vendored
3
cache/memory.go
vendored
@@ -26,7 +26,7 @@ type MemoryCache struct {
|
||||
lock sync.RWMutex
|
||||
dur time.Duration
|
||||
items map[string]*MemoryItem
|
||||
Every int // run an expiration check Every cloc; time
|
||||
Every int // run an expiration check Every clock time
|
||||
}
|
||||
|
||||
// NewMemoryCache returns a new MemoryCache.
|
||||
@@ -52,6 +52,7 @@ func (bc *MemoryCache) Get(name string) interface{} {
|
||||
}
|
||||
|
||||
// Put cache to memory.
|
||||
// if expired is 0, it will be cleaned by next gc operation ( default gc clock is 1 minute).
|
||||
func (bc *MemoryCache) Put(name string, value interface{}, expired int64) error {
|
||||
bc.lock.Lock()
|
||||
defer bc.lock.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user