From 1325a145d814c0fce38603a2468037f1deca4884 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 22 Mar 2019 15:08:43 +0800 Subject: [PATCH] fix issue in config auto reload of gcfg --- g/os/gcfg/gcfg.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/g/os/gcfg/gcfg.go b/g/os/gcfg/gcfg.go index b5dc019c2..6fb86c8d0 100644 --- a/g/os/gcfg/gcfg.go +++ b/g/os/gcfg/gcfg.go @@ -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 })