diff --git a/frontend/src/app/workspaces/[workspaceId]/workflows/[workflowId]/executions/layout.tsx b/frontend/src/app/workspaces/[workspaceId]/workflows/[workflowId]/executions/layout.tsx index 0d3e7588e..5e56e5554 100644 --- a/frontend/src/app/workspaces/[workspaceId]/workflows/[workflowId]/executions/layout.tsx +++ b/frontend/src/app/workspaces/[workspaceId]/workflows/[workflowId]/executions/layout.tsx @@ -46,6 +46,7 @@ export default function WorkflowExecutionsLayout({ ) } +const REFETCH_INTERVAL = 2000 function WorkflowExecutionsPanelGroup({ workflowId, defaultLayout = [15, 15, 70], @@ -65,7 +66,7 @@ function WorkflowExecutionsPanelGroup({ workflowExecutions, workflowExecutionsError, workflowExecutionsIsLoading, - } = useWorkflowExecutions(workflowId) + } = useWorkflowExecutions(workflowId, { refetchInterval: REFETCH_INTERVAL }) // Adjust onCollapse to match the expected signature const handleCollapse = () => { diff --git a/frontend/src/lib/hooks.tsx b/frontend/src/lib/hooks.tsx index e952b54d2..0ec577ae2 100644 --- a/frontend/src/lib/hooks.tsx +++ b/frontend/src/lib/hooks.tsx @@ -350,7 +350,12 @@ export function useWorkspaceManager() { } } -export function useWorkflowExecutions(workflowId: string) { +export function useWorkflowExecutions( + workflowId: string, + options?: { + refetchInterval?: number + } +) { const { workspaceId } = useWorkspace() const { data: workflowExecutions, @@ -363,6 +368,7 @@ export function useWorkflowExecutions(workflowId: string) { workspaceId, workflowId, }), + ...options, }) return { workflowExecutions,