next-issue 6.6.89 → 6.6.90
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/serve.mjs +5 -1
- package/package.json +1 -1
package/dist/serve.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
1
2
|
import { mkdir, rename, rm } from 'node:fs/promises';
|
|
2
3
|
import { createServer } from 'node:http';
|
|
3
4
|
import { basename, dirname, join } from 'node:path';
|
|
@@ -35,6 +36,9 @@ export async function startWorker(options) {
|
|
|
35
36
|
const server = createServer();
|
|
36
37
|
const sockets = new WebSocketServer({ server });
|
|
37
38
|
const sendQuestions = questionSender(options.questions);
|
|
39
|
+
// Taken outside any run, so a question read that an issue end starts does not take on
|
|
40
|
+
// the run's stop, command log, children or default timeout.
|
|
41
|
+
const outsideRuns = AsyncLocalStorage.snapshot();
|
|
38
42
|
const busy = () => [...runs.values()].some(active);
|
|
39
43
|
let idleTimer;
|
|
40
44
|
const { closed, close } = closer(async () => {
|
|
@@ -67,7 +71,7 @@ export async function startWorker(options) {
|
|
|
67
71
|
broadcast(sockets, runs);
|
|
68
72
|
};
|
|
69
73
|
broadcast(sockets, runs);
|
|
70
|
-
withRunChildren(run.children, () => options.runRepo(root, args, runControls(run, update, () => void sendQuestions(root, () => sockets.clients))))
|
|
74
|
+
withRunChildren(run.children, () => options.runRepo(root, args, runControls(run, update, () => outsideRuns(() => void sendQuestions(root, () => sockets.clients)))))
|
|
71
75
|
.then(() => update({ ...run.progress, status: endStatus(run) }), (error) => update({ ...run.progress, status: 'failed', error: message(error) }))
|
|
72
76
|
.finally(closeWhenIdle);
|
|
73
77
|
};
|