Skip to content

Commit

Permalink
feat(ui): Add polling for workflow runs history
Browse files Browse the repository at this point in the history
  • Loading branch information
daryllimyt committed Nov 28, 2024
1 parent 522aae9 commit e6e75f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default function WorkflowExecutionsLayout({
)
}

const REFETCH_INTERVAL = 2000
function WorkflowExecutionsPanelGroup({
workflowId,
defaultLayout = [15, 15, 70],
Expand All @@ -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 = () => {
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/lib/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -363,6 +368,7 @@ export function useWorkflowExecutions(workflowId: string) {
workspaceId,
workflowId,
}),
...options,
})
return {
workflowExecutions,
Expand Down

0 comments on commit e6e75f2

Please sign in to comment.