Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
improvement(pki-discovery): keep a slow background poll so newly started scans are detected
Claudef0ea7c47f69b
diff --git a/frontend/src/hooks/api/pkiDiscovery/queries.tsx b/frontend/src/hooks/api/pkiDiscovery/queries.tsxindex 7ab288f46b..373b95a542 100644--- a/frontend/src/hooks/api/pkiDiscovery/queries.tsx+++ b/frontend/src/hooks/api/pkiDiscovery/queries.tsx@@ -44,6 +44,9 @@ export const pkiInstallationKeys = {type TPollingOptions = { refetchInterval?: number | false };const SCAN_IN_FLIGHT_POLL_MS = 5000;+// Slow background poll while idle so a scan started elsewhere (scheduled auto-scan, or a+// stale terminal status read from a replica right after triggering) is still picked up.+const SCAN_IDLE_POLL_MS = 30000;export const isPkiDiscoveryScanInFlight = (status?: PkiDiscoveryScanStatus | null) =>status === PkiDiscoveryScanStatus.Pending || status === PkiDiscoveryScanStatus.Running;@@ -86,7 +89,9 @@ export const useGetPkiDiscovery = ({ discoveryId }: TGetPkiDiscoveryDTO) => {},enabled: Boolean(discoveryId),refetchInterval: (query) =>- isPkiDiscoveryScanInFlight(query.state.data?.lastScanStatus) ? SCAN_IN_FLIGHT_POLL_MS : false+ isPkiDiscoveryScanInFlight(query.state.data?.lastScanStatus)+ ? SCAN_IN_FLIGHT_POLL_MS+ : SCAN_IDLE_POLL_MS});};