next-issue 16.5.1 → 16.5.2
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/cli/start.mjs +1 -1
- package/dist/cli/switch-run.mjs +5 -5
- package/dist/cli.mjs +2 -2
- package/dist/shared/lock.mjs +1 -1
- package/dist/shared/observe.mjs +1 -1
- package/dist/worker/serve.mjs +4 -4
- package/package.json +1 -1
package/dist/cli/start.mjs
CHANGED
|
@@ -9,7 +9,7 @@ const REFUSED_GOING = [
|
|
|
9
9
|
'the worker is restarting, try again soon',
|
|
10
10
|
];
|
|
11
11
|
const SILENT = 'the next-issue worker did not answer';
|
|
12
|
-
const STARTED = '
|
|
12
|
+
const STARTED = 'the run started in the worker; follow it with npx -y next-issue@latest logs and stop it with npx -y next-issue@latest stop\n';
|
|
13
13
|
export async function startInWorker(root, argv) {
|
|
14
14
|
const version = await packageVersion();
|
|
15
15
|
const given = givenStartFlags(argv);
|
package/dist/cli/switch-run.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { isNewer } from '../shared/protocol.mjs';
|
|
|
3
3
|
import { packageVersion } from '../shared/version.mjs';
|
|
4
4
|
import { ANSWER_TIMEOUT_MS, CLOSED, findWorker, going, } from '../shared/worker-client.mjs';
|
|
5
5
|
const FIELDS = { watch: 'watching', hunt: 'hunting' };
|
|
6
|
-
const NO_RUN = '
|
|
6
|
+
const NO_RUN = 'no run is going in this repository\n';
|
|
7
7
|
function onOffText(on) {
|
|
8
8
|
return on === true ? 'on' : 'off';
|
|
9
9
|
}
|
|
@@ -13,7 +13,7 @@ export function switchInWorker(root, name, on) {
|
|
|
13
13
|
throw new Error(`the worker of the going run is older than next-issue, so it cannot switch ${FIELDS[name]}. Stop the run, then start it again`);
|
|
14
14
|
}
|
|
15
15
|
const progress = await switched(connection, root, name, on);
|
|
16
|
-
return `
|
|
16
|
+
return `watching ${onOffText(progress.watching)}, hunting ${onOffText(progress.hunting)}\n`;
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
async function inWorker(root, act) {
|
|
@@ -56,10 +56,10 @@ export function switched(connection, root, name, on) {
|
|
|
56
56
|
export function stopInWorker(root) {
|
|
57
57
|
return inWorker(root, async (connection, progress) => {
|
|
58
58
|
if (progress.status === 'stopping' && progress.upgrade === undefined) {
|
|
59
|
-
return '
|
|
59
|
+
return 'the run is stopping already\n';
|
|
60
60
|
}
|
|
61
61
|
const reply = await stopReply(connection, root);
|
|
62
|
-
return
|
|
62
|
+
return `${stopText(progress, reply)}\n`;
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
function stopReply(connection, root) {
|
|
@@ -103,7 +103,7 @@ export function statusInWorker(root) {
|
|
|
103
103
|
}
|
|
104
104
|
export function statusText(version, progress) {
|
|
105
105
|
const lines = [
|
|
106
|
-
`
|
|
106
|
+
`the run is ${progress.status} in worker ${version}`,
|
|
107
107
|
`watching ${onOffText(progress.watching)}, hunting ${onOffText(progress.hunting)}`,
|
|
108
108
|
];
|
|
109
109
|
if (progress.upgrade !== undefined) {
|
package/dist/cli.mjs
CHANGED
|
@@ -58,7 +58,7 @@ async function main() {
|
|
|
58
58
|
async function logs(root) {
|
|
59
59
|
const file = await newestRunLog(root);
|
|
60
60
|
if (file === undefined) {
|
|
61
|
-
await write(process.stderr, `
|
|
61
|
+
await write(process.stderr, `no run log in ${STATE_DIR}/runs\n`);
|
|
62
62
|
return 1;
|
|
63
63
|
}
|
|
64
64
|
const tail = process.stdout.isTTY ? Math.max(1, (process.stdout.rows || 24) - 1) : undefined;
|
|
@@ -93,6 +93,6 @@ async function excludeStateDirectories(root, stream) {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
main().then((code) => process.exit(code), async (error) => {
|
|
96
|
-
await write(process.stderr,
|
|
96
|
+
await write(process.stderr, `${message(error)}\n`);
|
|
97
97
|
process.exit(1);
|
|
98
98
|
});
|
package/dist/shared/lock.mjs
CHANGED
|
@@ -169,7 +169,7 @@ function heldLock(path, id, text) {
|
|
|
169
169
|
export async function lock(path, waitMs, readStart = processStart) {
|
|
170
170
|
const started = await readStart(process.pid);
|
|
171
171
|
if (started === undefined) {
|
|
172
|
-
throw new Error('
|
|
172
|
+
throw new Error('cannot read the start time of this process');
|
|
173
173
|
}
|
|
174
174
|
const text = `${process.pid} ${started}\n`;
|
|
175
175
|
const deadline = Date.now() + waitMs;
|
package/dist/shared/observe.mjs
CHANGED
|
@@ -28,7 +28,7 @@ class Sink {
|
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
this.failed = true;
|
|
31
|
-
this.output(`
|
|
31
|
+
this.output(`the run log ${this.file} cannot be written (${message(error)}); the run goes on without it\n`);
|
|
32
32
|
}
|
|
33
33
|
write(record) {
|
|
34
34
|
if (!this.failed) {
|
package/dist/worker/serve.mjs
CHANGED
|
@@ -47,7 +47,7 @@ export async function startWorker(options) {
|
|
|
47
47
|
}
|
|
48
48
|
catch (error) {
|
|
49
49
|
const reason = `the worker could not start next-issue ${restart}: ${message(error)}`;
|
|
50
|
-
process.stderr.write(
|
|
50
|
+
process.stderr.write(`${reason}\n`);
|
|
51
51
|
run.progress = { ...run.progress, status: 'failed', error: reason };
|
|
52
52
|
broadcast(sockets, runs);
|
|
53
53
|
}
|
|
@@ -160,7 +160,7 @@ export async function startWorker(options) {
|
|
|
160
160
|
...(summary === undefined ? {} : { summary }),
|
|
161
161
|
});
|
|
162
162
|
}, (error) => {
|
|
163
|
-
process.stderr.write(
|
|
163
|
+
process.stderr.write(`${message(error)}\n`);
|
|
164
164
|
update({ ...run.progress, status: 'failed', error: message(error) });
|
|
165
165
|
return sendAllSent(sockets, { type: 'end', root, code: 1, error: message(error) });
|
|
166
166
|
})
|
|
@@ -284,7 +284,7 @@ export async function serve(root, logCheckMs = LOG_CHECK_MS) {
|
|
|
284
284
|
});
|
|
285
285
|
if (worker === undefined) {
|
|
286
286
|
stopTrimming();
|
|
287
|
-
process.stderr.write('
|
|
287
|
+
process.stderr.write('another worker is running\n');
|
|
288
288
|
return 1;
|
|
289
289
|
}
|
|
290
290
|
const end = (signal) => {
|
|
@@ -300,7 +300,7 @@ export async function serve(root, logCheckMs = LOG_CHECK_MS) {
|
|
|
300
300
|
process.on('SIGTERM', onTerminate);
|
|
301
301
|
process.on('SIGINT', onInterrupt);
|
|
302
302
|
process.on('SIGHUP', onHangUp);
|
|
303
|
-
process.stderr.write(`
|
|
303
|
+
process.stderr.write(`worker listening on ${paths.socketPath}\n`);
|
|
304
304
|
await worker.closed;
|
|
305
305
|
stopTrimming();
|
|
306
306
|
return 0;
|