From a3be6356488508ca5a878fe3ba879fc348ce04e4 Mon Sep 17 00:00:00 2001 From: Iqbal Date: Tue, 3 Nov 2026 12:42:24 +0700 Subject: [PATCH] Poll run history and processing documents every 5 seconds, not 3 Both are the app's fastest polls; at 5 seconds no read runs more often than that, which leaves the engine more room when several tabs are open. Co-Authored-By: Claude Opus 5.5 --- src/pages/Brain.tsx | 2 +- src/pages/Schedule.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Brain.tsx b/src/pages/Brain.tsx index 05842e6..f31683c 100644 --- a/src/pages/Brain.tsx +++ b/src/pages/Brain.tsx @@ -28,7 +28,7 @@ const extOf = (name: string) => '.' + (name.split('.').pop() ?? '').toLowerCase( export const useDocuments = () => useQuery({ queryKey: ['documents'], queryFn: listDocuments, - refetchInterval: q => (q.state.data?.some(d => phaseOf(d) === 'working') ? 3000 : 20_000), + refetchInterval: q => (q.state.data?.some(d => phaseOf(d) === 'working') ? 5000 : 20_000), }) const PHASES: Phase[] = ['ready', 'working', 'answer', 'failed'] diff --git a/src/pages/Schedule.tsx b/src/pages/Schedule.tsx index 12e55cb..2c5d872 100644 --- a/src/pages/Schedule.tsx +++ b/src/pages/Schedule.tsx @@ -265,7 +265,7 @@ function RunHistory({ agentId }: { agentId: number }) { const runs = useQuery({ queryKey: ['runs', agentId], queryFn: () => listRuns(agentId), - refetchInterval: q => (q.state.data?.some(r => ['queued', 'planning', 'running'].includes(r.status)) ? 3000 : false), + refetchInterval: q => (q.state.data?.some(r => ['queued', 'planning', 'running'].includes(r.status)) ? 5000 : false), }) if (runs.isPending) return
if (runs.isError) return
{runs.error.message}