Skip to content

Commit

Permalink
chore: refresh action step every second when not completed
Browse files Browse the repository at this point in the history
  • Loading branch information
mainawycliffe authored and moshloop committed Sep 9, 2024
1 parent aace983 commit de79a29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ export default function PlaybookRunActionFetch({
queryFn: () => getPlaybookRunActionById(playbookRunActionId),
enabled: !!playbookRunActionId,
staleTime: 0,
cacheTime: 0
cacheTime: 0,
refetchInterval: (data) => {
if (data?.status !== "completed" && data?.status !== "failed") {
return 1000;
}
return false;
}
});

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/playbooks/PlaybookRunsDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function PlaybookRunsDetailsPage() {
playbookRun?.status === "waiting" ||
playbookRun?.status === "pending"
) {
return 5000;
return 2000;
}
return false;
}
Expand Down

0 comments on commit de79a29

Please sign in to comment.