Skip to content

Commit

Permalink
Fix preview race condition
Browse files Browse the repository at this point in the history
Since the API calls to get the pipeline and job object are made in
parallel, if the job call returned first it would trigger the effect to
get the job output and short-circuit.
  • Loading branch information
jbeisen committed Sep 14, 2023
1 parent 9d85fac commit d7de168
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arroyo-console/src/routes/pipelines/CreatePipeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ export function CreatePipeline() {
};

useEffect(() => {
if (pipeline && job) {
if (pipelineId && job) {
if (outputSource) {
outputSource.close();
}
setOutputSource(useJobOutput(sseHandler, pipeline.id, job.id));
setOutputSource(useJobOutput(sseHandler, pipelineId, job.id));
}
}, [job?.id]);

Expand Down

0 comments on commit d7de168

Please sign in to comment.