mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-09-01 15:02:58 +08:00
f6aa9dc3c8
ConfigManager.refreshLoop reloads the Prompt Guard config every 5s and Reload logged config_loaded on every successful load, so an unchanged config produced up to ~17k identical lines per instance per day and buried real configuration changes. Log the event only when the reload carries news: the first snapshot, a new config version (every admin save bumps it under the advisory lock in UpdateConfig), a flip of the global risk control gate (a separate setting that leaves the version untouched), or a recovery from a failed reload so the degraded-to-healthy transition stays visible. This mirrors logInvalidTokenEndpoints, which already warns once per change rather than on every refresh.