Skip to content

Commit

Permalink
fix job overview page polling every second (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
alishakawaguchi authored Nov 2, 2023
1 parent 2f6f457 commit b7192e5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions frontend/app/jobs/[id]/components/RecentRuns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ export default function JobRecentRuns({ jobId }: Props): ReactElement {
}

useEffect(() => {
const interval = setInterval(() => {
// Set a timeout to refresh once after 3 second
// used to show new runs after trigger
const timeoutId = setTimeout(() => {
onRefreshClick();
}, 1000);
return () => clearInterval(interval);
}, [jobId]);
}, 3000);
return () => clearTimeout(timeoutId);
}, []);

const jobRunsIdMap =
jobRuns?.jobRuns.reduce(
Expand Down

0 comments on commit b7192e5

Please sign in to comment.