1
0
mirror of https://github.com/astaxie/beego.git synced 2024-06-02 08:33:28 +00:00

Improved definition of DefaultEvery

This commit is contained in:
IamCathal 2020-08-05 17:56:11 +01:00
parent 2f5683610f
commit e7d8bab5d9

4
pkg/cache/memory.go vendored
View File

@ -22,7 +22,7 @@ import (
) )
var ( var (
// Recycle the expired cache items in memory (in seconds) // Timer for how often to recycle the expired cache items in memory (in seconds)
DefaultEvery = 60 // 1 minute DefaultEvery = 60 // 1 minute
) )
@ -81,7 +81,7 @@ func (bc *MemoryCache) GetMulti(names []string) []interface{} {
} }
// Put puts cache into memory. // Put puts cache into memory.
// If lifespan is 0, it will never overwrite this value // If lifespan is 0, it will never overwrite this value unless restarted
func (bc *MemoryCache) Put(name string, value interface{}, lifespan time.Duration) error { func (bc *MemoryCache) Put(name string, value interface{}, lifespan time.Duration) error {
bc.Lock() bc.Lock()
defer bc.Unlock() defer bc.Unlock()