mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 10:10:54 +00:00
fix when there's no config
This commit is contained in:
parent
fad8100804
commit
5f36a3ae4a
1
cache/memory.go
vendored
1
cache/memory.go
vendored
@ -92,6 +92,7 @@ func (bc *MemoryCache) StartAndGC(config string) error {
|
||||
var cf map[string]int
|
||||
json.Unmarshal([]byte(config), &cf)
|
||||
if _, ok := cf["every"]; !ok {
|
||||
cf = make(map[string]int)
|
||||
cf["interval"] = DefaultEvery
|
||||
}
|
||||
dur, err := time.ParseDuration(fmt.Sprintf("%ds", cf["interval"]))
|
||||
|
Loading…
Reference in New Issue
Block a user