5f36a3ae by astaxie

fix when there's no config

1 parent fad81008
...@@ -92,6 +92,7 @@ func (bc *MemoryCache) StartAndGC(config string) error { ...@@ -92,6 +92,7 @@ func (bc *MemoryCache) StartAndGC(config string) error {
92 var cf map[string]int 92 var cf map[string]int
93 json.Unmarshal([]byte(config), &cf) 93 json.Unmarshal([]byte(config), &cf)
94 if _, ok := cf["every"]; !ok { 94 if _, ok := cf["every"]; !ok {
95 cf = make(map[string]int)
95 cf["interval"] = DefaultEvery 96 cf["interval"] = DefaultEvery
96 } 97 }
97 dur, err := time.ParseDuration(fmt.Sprintf("%ds", cf["interval"])) 98 dur, err := time.ParseDuration(fmt.Sprintf("%ds", cf["interval"]))
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!