fix(proxy): invalidate health cache when proxy stops

The previous fix (e081c75) only cleared the database records but
didn't invalidate the React Query cache. This caused stale health
badges to appear when restarting the proxy.

Now invalidates all providerHealth queries on stop, ensuring the
frontend fetches fresh data from the database.
This commit is contained in:
Jason
2025-12-15 23:12:26 +08:00
parent 6dcf268317
commit 1e5bab1cb6
+2
View File
@@ -65,6 +65,8 @@ export function useProxyStatus() {
);
queryClient.invalidateQueries({ queryKey: ["proxyStatus"] });
queryClient.invalidateQueries({ queryKey: ["proxyTakeoverActive"] });
// 清除所有供应商健康状态缓存(后端已清空数据库记录)
queryClient.invalidateQueries({ queryKey: ["providerHealth"] });
},
onError: (error: Error) => {
const detail = extractErrorMessage(error) || "未知错误";