mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-07 14:58:23 +08:00
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.