From ebfd3802c6cc77719ec292ec31787b0d946dfc14 Mon Sep 17 00:00:00 2001 From: Iqbal Date: Thu, 29 Oct 2026 17:20:43 +0700 Subject: [PATCH] Read each schedule's production status once a minute Every content schedule row on the Schedule page asked the engine for its production status every 5s while a plan was running, a steady stream of /content requests during production. Read it once a minute; starting a production still refreshes it at once. Co-Authored-By: Claude Opus 5.5 --- src/pages/Schedule.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/Schedule.tsx b/src/pages/Schedule.tsx index 585efad..b4e1e23 100644 --- a/src/pages/Schedule.tsx +++ b/src/pages/Schedule.tsx @@ -151,11 +151,13 @@ function ScheduleRow({ schedule, owners }: { schedule: Schedule; owners?: Owners ) } -// Content schedules report this week's progress from the engine's production period. +// Content schedules report this week's progress from the engine's production period. Each row +// asks for its own, so it is read once a minute; starting a production refreshes it at once. const useProduction = (agentId: number) => useQuery({ queryKey: ['production', agentId], queryFn: () => productionStatus(agentId), - refetchInterval: q => (q.state.data?.plans.some(p => PLAN_ACTIVE.has(p.status)) ? 5000 : 60_000), + refetchInterval: 60_000, + staleTime: 60_000, }) function ProductionLine({ agentId, active }: { agentId: number; active: boolean }) {