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 <noreply@anthropic.com>
This commit is contained in:
@@ -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({
|
const useProduction = (agentId: number) => useQuery({
|
||||||
queryKey: ['production', agentId],
|
queryKey: ['production', agentId],
|
||||||
queryFn: () => productionStatus(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 }) {
|
function ProductionLine({ agentId, active }: { agentId: number; active: boolean }) {
|
||||||
|
|||||||
Reference in New Issue
Block a user