mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 12:50:55 +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
|
var cf map[string]int
|
||||||
json.Unmarshal([]byte(config), &cf)
|
json.Unmarshal([]byte(config), &cf)
|
||||||
if _, ok := cf["every"]; !ok {
|
if _, ok := cf["every"]; !ok {
|
||||||
|
cf = make(map[string]int)
|
||||||
cf["interval"] = DefaultEvery
|
cf["interval"] = DefaultEvery
|
||||||
}
|
}
|
||||||
dur, err := time.ParseDuration(fmt.Sprintf("%ds", cf["interval"]))
|
dur, err := time.ParseDuration(fmt.Sprintf("%ds", cf["interval"]))
|
||||||
|
Loading…
Reference in New Issue
Block a user