fix(config): remove duplicated reload error

This commit is contained in:
yusing
2025-12-21 11:23:42 +08:00
parent e6308c4caa
commit 6ca64ea3eb

View File

@@ -90,8 +90,7 @@ func Reload() gperr.Error {
if err != nil { if err != nil {
newState.Task().FinishAndWait(err) newState.Task().FinishAndWait(err)
config.WorkingState.Store(GetState()) config.WorkingState.Store(GetState())
logNotifyError("reload", err) return gperr.Wrap(err, ansi.Warning("using last config"))
return gperr.New(ansi.Warning("using last config")).With(err)
} }
// flush temporary log // flush temporary log
@@ -117,7 +116,7 @@ func WatchChanges() {
configEventFlushInterval, configEventFlushInterval,
OnConfigChange, OnConfigChange,
func(err gperr.Error) { func(err gperr.Error) {
logNotifyError("config reload", err) logNotifyError("reload", err)
}, },
) )
eventQueue.Start(cfgWatcher.Events(t.Context())) eventQueue.Start(cfgWatcher.Events(t.Context()))