From 6c90a919f0b724ab980c2567605b166c9d441e8a Mon Sep 17 00:00:00 2001 From: yangdx Date: Tue, 15 Apr 2025 21:23:29 +0800 Subject: [PATCH] Optimize health check --- lightrag_webui/src/App.tsx | 2 +- lightrag_webui/src/features/DocumentManager.tsx | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/lightrag_webui/src/App.tsx b/lightrag_webui/src/App.tsx index 12d63d45..55e6268a 100644 --- a/lightrag_webui/src/App.tsx +++ b/lightrag_webui/src/App.tsx @@ -76,7 +76,7 @@ function App() { if (!healthCheckInitializedRef.current) { healthCheckInitializedRef.current = true; // Immediate health check on first load - // performHealthCheck(); + performHealthCheck(); } // Set interval for periodic execution diff --git a/lightrag_webui/src/features/DocumentManager.tsx b/lightrag_webui/src/features/DocumentManager.tsx index 1ed54b5a..99e8d941 100644 --- a/lightrag_webui/src/features/DocumentManager.tsx +++ b/lightrag_webui/src/features/DocumentManager.tsx @@ -369,15 +369,6 @@ export default function DocumentManager() { failed: docs?.statuses?.failed?.length || 0 } - // Check if any status count has changed - const hasStatusCountChange = (Object.keys(newStatusCounts) as Array).some( - status => newStatusCounts[status] !== prevStatusCounts.current[status] - ) - - // Trigger health check if changes detected and component is still mounted - if (hasStatusCountChange && isMountedRef.current) { - useBackendState.getState().check() - } // Only update state if component is still mounted if (isMountedRef.current) {