Optimize health check
This commit is contained in:
parent
aefd08823e
commit
6c90a919f0
2 changed files with 1 additions and 10 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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<keyof typeof newStatusCounts>).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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue