Skip to content

Commit 3ea6a2f

Browse files
Merge pull request #533 from zenml-io/dev
refactor: remove polling from dag visualizer (#532)
2 parents 3af5bf3 + 6d6e984 commit 3ea6a2f

File tree

4 files changed

+0
-105
lines changed

4 files changed

+0
-105
lines changed

src/ui/layouts/pipelines/RunDetail/useService.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -51,33 +51,6 @@ export const useService = (): ServiceInterface => {
5151
// eslint-disable-next-line react-hooks/exhaustive-deps
5252
}, [isMounted, setIsMounted]);
5353

54-
useEffect(() => {
55-
if (run.body?.status === 'running') {
56-
const intervalId = setInterval(() => {
57-
dispatch(
58-
runsActions.runForId({
59-
pipelineId: pipelineId,
60-
runId: id,
61-
onSuccess: (res) => {
62-
if (res.status !== 'running') {
63-
dispatch(
64-
runsActions.graphForRun({
65-
runId: id,
66-
}),
67-
);
68-
}
69-
},
70-
}),
71-
);
72-
}, 12000);
73-
74-
return () => {
75-
clearInterval(intervalId);
76-
};
77-
}
78-
// This is important
79-
}, [pipelineId, id, run, dispatch]);
80-
8154
const fetchMetaData = async () => {
8255
const response = await axios.get(
8356
`${process.env.REACT_APP_BASE_API_URL}/run-metadata?pipeline_run_id=${id}&key=orchestrator_url`,

src/ui/layouts/repositories/RunDetail/useService.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -51,33 +51,6 @@ export const useService = (): ServiceInterface => {
5151
// eslint-disable-next-line react-hooks/exhaustive-deps
5252
}, [isMounted, setIsMounted]);
5353

54-
useEffect(() => {
55-
if (run.body?.status === 'running') {
56-
const intervalId = setInterval(() => {
57-
dispatch(
58-
runsActions.runForId({
59-
repositoryID: repositoryID,
60-
runId: id,
61-
onSuccess: (res) => {
62-
if (res.status !== 'running') {
63-
dispatch(
64-
runsActions.graphForRun({
65-
runId: id,
66-
}),
67-
);
68-
}
69-
},
70-
}),
71-
);
72-
}, 12000);
73-
74-
return () => {
75-
clearInterval(intervalId);
76-
};
77-
}
78-
// This is important
79-
}, [repositoryID, id, run, dispatch]);
80-
8154
const fetchMetaData = async () => {
8255
const response = await axios.get(
8356
`${process.env.REACT_APP_BASE_API_URL}/run-metadata?pipeline_run_id=${id}&key=orchestrator_url`,

src/ui/layouts/runs/RunDetail/useService.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -61,31 +61,6 @@ export const useService = (): ServiceInterface => {
6161
}
6262
// eslint-disable-next-line react-hooks/exhaustive-deps
6363
}, [isMounted, setIsMounted]);
64-
useEffect(() => {
65-
if (run.body?.status === 'running') {
66-
const intervalId = setInterval(() => {
67-
dispatch(
68-
runsActions.runForId({
69-
runId: runId,
70-
onSuccess: (res) => {
71-
if (res.status !== 'running') {
72-
dispatch(
73-
runsActions.graphForRun({
74-
runId: runId,
75-
}),
76-
);
77-
}
78-
},
79-
}),
80-
);
81-
}, 5000);
82-
83-
return () => {
84-
clearInterval(intervalId);
85-
};
86-
}
87-
// This is important
88-
}, [runId, run, dispatch]);
8964

9065
const fetchMetaData = async () => {
9166
const response = await axios.get(

src/ui/layouts/stacks/RunDetail/useService.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -51,32 +51,6 @@ export const useService = (): ServiceInterface => {
5151
// eslint-disable-next-line react-hooks/exhaustive-deps
5252
}, [isMounted, setIsMounted]);
5353

54-
useEffect(() => {
55-
if (run.body?.status === 'running') {
56-
const intervalId = setInterval(() => {
57-
dispatch(
58-
runsActions.runForId({
59-
stackId: stackId,
60-
runId: id,
61-
onSuccess: (res) => {
62-
if (res.status !== 'running') {
63-
dispatch(
64-
runsActions.graphForRun({
65-
runId: id,
66-
}),
67-
);
68-
}
69-
},
70-
}),
71-
);
72-
}, 5000);
73-
74-
return () => {
75-
clearInterval(intervalId);
76-
};
77-
}
78-
// This is important
79-
}, [stackId, id, run, dispatch]);
8054
const fetchMetaData = async () => {
8155
const response = await axios.get(
8256
`${process.env.REACT_APP_BASE_API_URL}/run-metadata?pipeline_run_id=${id}&key=orchestrator_url`,

0 commit comments

Comments
 (0)