mirror of
https://gitee.com/johng/gf.git
synced 2024-12-01 11:48:09 +08:00
fix issue in config auto reload of gcfg
This commit is contained in:
parent
9bc49c0b29
commit
1325a145d8
@ -176,11 +176,11 @@ func (c *Config) getJson(file...string) *gjson.Json {
|
||||
j.SetViolenceCheck(c.vc.Val())
|
||||
// 添加配置文件监听,如果有任何变化,删除文件内容缓存,下一次查询会自动更新
|
||||
gfsnotify.Add(filePath, func(event *gfsnotify.Event) {
|
||||
c.jsons.Remove(event.Path)
|
||||
c.jsons.Remove(name)
|
||||
})
|
||||
return j
|
||||
} else {
|
||||
glog.Errorfln(`[gcfg] Load config file "%s" failed: %s`, filePath, err.Error())
|
||||
glog.Criticalfln(`[gcfg] Load config file "%s" failed: %s`, filePath, err.Error())
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user