mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-29 01:25:33 +08:00
fix(proxy): reset health badges when proxy stops
Clear all provider_health records when stopping the proxy server, ensuring health badges reset to "healthy" state. This fixes the inconsistency where circuit breakers (in memory) would reset on stop but health badges (in database) would retain stale state.
This commit is contained in:
@@ -306,6 +306,12 @@ impl ProxyService {
|
||||
.await
|
||||
.map_err(|e| format!("删除备份失败: {e}"))?;
|
||||
|
||||
// 5. 重置健康状态(让健康徽章恢复为正常)
|
||||
self.db
|
||||
.clear_all_provider_health()
|
||||
.await
|
||||
.map_err(|e| format!("重置健康状态失败: {e}"))?;
|
||||
|
||||
log::info!("代理已停止,Live 配置已恢复");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user