Add LandSAR cluster worker deployment

This commit is contained in:
2026-06-24 14:10:58 +08:00
parent 71c524967c
commit da09ba05cb
88 changed files with 9300 additions and 3011 deletions
+10 -3
View File
@@ -2,7 +2,7 @@ import { useCallback, useEffect, useRef } from 'react';
import apiClient from '../api/client';
import { getHealth } from '../api/health';
const HEALTH_POLL_INTERVAL_MS = 30000;
const HEALTH_POLL_INTERVAL_MS = 5 * 60 * 1000;
const STARTUP_RETRY_DELAYS_MS = [750, 1500, 3000];
const sleep = (delayMs) => new Promise((resolve) => setTimeout(resolve, delayMs));
@@ -95,6 +95,8 @@ export default function useAppAuthLifecycle({
if (userFromLogin) {
setCurrentUser(userFromLogin);
setAuthChecked(true);
void fetchCurrentUser({ clearOnFailure: false });
return;
}
await fetchCurrentUser({ clearOnFailure: !userFromLogin });
}, [fetchCurrentUser, setCurrentUser, setAuthChecked]);
@@ -236,11 +238,16 @@ export default function useAppAuthLifecycle({
}, [fetchCurrentUser, fetchLicenseStatus]);
useEffect(() => {
void fetchHealthStatus();
const startupTimer = setTimeout(() => {
void fetchHealthStatus({ silent: true });
}, 1500);
const interval = setInterval(() => {
void fetchHealthStatus({ silent: true });
}, HEALTH_POLL_INTERVAL_MS);
return () => clearInterval(interval);
return () => {
clearTimeout(startupTimer);
clearInterval(interval);
};
}, [fetchHealthStatus]);
return {