fix when there's no config
Showing
1 changed file
with
1 additions
and
0 deletions
| ... | @@ -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"])) | ... | ... |
-
Please register or sign in to post a comment