Skip to content

Commit cdf82a2

Browse files
Ping server for run status every 2s if it has not started yet.
1 parent 99ac0b1 commit cdf82a2

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

app/bin/ea/[id]/page.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ export default function Execution() {
264264
) {
265265
startLogStreaming(id);
266266
}
267+
} else if (newStatus === "scheduled") {
268+
setTimeout(() => {
269+
fetchData();
270+
}, 2000); // Retry after 2 seconds.
267271
} else {
268272
// If status is completed, error, timed_out etc., stop SSE and fetch final results
269273
stopLogStreaming(); // Ensure any active stream is stopped

app/bin/gp/[id]/page.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ export default function GPRunResult() {
7171
) {
7272
startLogStreaming(id); // Pass id here
7373
}
74+
} else if (newStatus === "scheduled") {
75+
setTimeout(() => {
76+
fetchData();
77+
}, 2000); // Retry after 2 seconds.
7478
} else {
7579
// If status is completed, error, timed_out etc., stop SSE and fetch final results
7680
stopLogStreaming(); // Ensure any active stream is stopped

app/bin/ml/[id]/page.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ export default function MLExecResult() {
7373
) {
7474
startLogStreaming(id); // Pass id here
7575
}
76+
} else if (newStatus === "scheduled") {
77+
setTimeout(() => {
78+
fetchData();
79+
}, 2000); // Retry after 2 seconds.
7680
} else {
7781
// If status is completed, error, timed_out etc., stop SSE and fetch final results
7882
stopLogStreaming(); // Ensure any active stream is stopped

app/bin/pso/[id]/page.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ export default function PSOExecResult() {
7070
) {
7171
startLogStreaming(id);
7272
}
73+
} else if (newStatus === "scheduled") {
74+
setTimeout(() => {
75+
fetchData();
76+
}, 2000); // Retry after 2 seconds.
7377
} else {
7478
stopLogStreaming();
7579
if (

0 commit comments

Comments
 (0)