@melaya/runner 1.0.12 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/connection.js +6 -3
- package/package.json +1 -1
package/dist/connection.js
CHANGED
|
@@ -133,15 +133,18 @@ export async function connect(opts) {
|
|
|
133
133
|
proc.on("exit", (code) => {
|
|
134
134
|
activeProcesses.delete(payload.runId);
|
|
135
135
|
const status = code === 0 ? "done" : "failed";
|
|
136
|
-
|
|
137
|
-
// Also emit a pushEvent so the frontend clears the LIVE state
|
|
138
|
-
// (runner:runComplete only updates the DB, it doesn't broadcast)
|
|
136
|
+
// Emit run_status FIRST (before runComplete deletes from ownedRunIds)
|
|
139
137
|
socket.emit("runner:event", {
|
|
140
138
|
run_id: payload.runId,
|
|
141
139
|
event_type: "run_status",
|
|
142
140
|
status,
|
|
143
141
|
project: payload.project,
|
|
144
142
|
});
|
|
143
|
+
// Small delay so the server processes run_status before runComplete
|
|
144
|
+
// removes the runId from ownedRunIds
|
|
145
|
+
setTimeout(() => {
|
|
146
|
+
socket.emit("runner:runComplete", { runId: payload.runId, status });
|
|
147
|
+
}, 200);
|
|
145
148
|
console.log(chalk.gray(` ■ Pipeline finished (exit ${code})\n`));
|
|
146
149
|
console.log(chalk.gray(" Waiting for pipeline runs...\n"));
|
|
147
150
|
});
|