mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 04:42:33 +02:00
refactor: move config reload error logging to separate method
This commit is contained in:
parent
864a43266d
commit
2c0d58f692
1 changed files with 5 additions and 3 deletions
|
@ -80,9 +80,7 @@ func WatchChanges() {
|
|||
t,
|
||||
configEventFlushInterval,
|
||||
OnConfigChange,
|
||||
func(err gperr.Error) {
|
||||
gperr.LogError("config reload error", err)
|
||||
},
|
||||
onReloadError,
|
||||
)
|
||||
eventQueue.Start(cfgWatcher.Events(t.Context()))
|
||||
}
|
||||
|
@ -105,6 +103,10 @@ func OnConfigChange(ev []events.Event) {
|
|||
}
|
||||
}
|
||||
|
||||
func onReloadError(err gperr.Error) {
|
||||
logging.Error().Msgf("config reload error: %s", err)
|
||||
}
|
||||
|
||||
func Reload() gperr.Error {
|
||||
// avoid race between config change and API reload request
|
||||
reloadMu.Lock()
|
||||
|
|
Loading…
Add table
Reference in a new issue