mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-19 04:40:52 +08:00
chore(log): Refine debug messages for config reloads
This commit is contained in:
@@ -171,7 +171,7 @@ func ApplyAccessProviders(manager *sdkaccess.Manager, oldCfg, newCfg *config.Con
|
|||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// log.Debug("auth providers unchanged after config update")
|
log.Debug("auth providers unchanged after config update")
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -456,6 +456,7 @@ func (w *Watcher) handleEvent(event fsnotify.Event) {
|
|||||||
|
|
||||||
// reloadConfig reloads the configuration and triggers a full reload
|
// reloadConfig reloads the configuration and triggers a full reload
|
||||||
func (w *Watcher) reloadConfig() bool {
|
func (w *Watcher) reloadConfig() bool {
|
||||||
|
log.Debug("=========================== CONFIG RELOAD ============================")
|
||||||
log.Debugf("starting config reload from: %s", w.configPath)
|
log.Debugf("starting config reload from: %s", w.configPath)
|
||||||
|
|
||||||
newConfig, errLoadConfig := config.LoadConfig(w.configPath)
|
newConfig, errLoadConfig := config.LoadConfig(w.configPath)
|
||||||
@@ -555,7 +556,7 @@ func (w *Watcher) reloadConfig() bool {
|
|||||||
|
|
||||||
// reloadClients performs a full scan and reload of all clients.
|
// reloadClients performs a full scan and reload of all clients.
|
||||||
func (w *Watcher) reloadClients(rescanAuth bool) {
|
func (w *Watcher) reloadClients(rescanAuth bool) {
|
||||||
log.Debugf("starting full client reload process")
|
log.Debugf("starting full client load process")
|
||||||
|
|
||||||
w.clientsMutex.RLock()
|
w.clientsMutex.RLock()
|
||||||
cfg := w.config
|
cfg := w.config
|
||||||
@@ -578,7 +579,7 @@ func (w *Watcher) reloadClients(rescanAuth bool) {
|
|||||||
if rescanAuth {
|
if rescanAuth {
|
||||||
// Load file-based clients when explicitly requested (startup or authDir change)
|
// Load file-based clients when explicitly requested (startup or authDir change)
|
||||||
authFileCount = w.loadFileClients(cfg)
|
authFileCount = w.loadFileClients(cfg)
|
||||||
log.Debugf("loaded %d new file-based clients", authFileCount)
|
log.Debugf("loaded %d file-based clients", authFileCount)
|
||||||
} else {
|
} else {
|
||||||
// Preserve existing auth hashes and only report current known count to avoid redundant scans.
|
// Preserve existing auth hashes and only report current known count to avoid redundant scans.
|
||||||
w.clientsMutex.RLock()
|
w.clientsMutex.RLock()
|
||||||
|
|||||||
Reference in New Issue
Block a user