hotpatch: remove consitent 2 sec interval api call to logs summary endpoint

This commit is contained in:
DESKTOP-RTLN3BA\$punk 2025-12-28 15:52:58 -08:00
parent 0e1ea9c30f
commit 46eb63fa11
4 changed files with 27 additions and 60 deletions

View file

@ -134,8 +134,11 @@ export default function DocumentsTable() {
toast.success(t("refresh_success") || "Documents refreshed");
}, [debouncedSearch, refetchSearch, refetchDocuments, t]);
// Set up polling for active tasks
const { summary } = useLogsSummary(searchSpaceId, 24, { refetchInterval: 5000 });
// Set up smart polling for active tasks - only polls when tasks are in progress
const { summary } = useLogsSummary(searchSpaceId, 24, {
enablePolling: true,
refetchInterval: 5000, // Poll every 5 seconds when tasks are active
});
const activeTasksCount = summary?.active_tasks.length || 0;
const prevActiveTasksCount = useRef(activeTasksCount);