appostle-installer 0.0.49 → 0.0.50
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.
|
@@ -10071,17 +10071,25 @@ async function stopRunningDaemon() {
|
|
|
10071
10071
|
await sleep(300);
|
|
10072
10072
|
return pid;
|
|
10073
10073
|
}
|
|
10074
|
+
var DAEMON_RESTART_TIMEOUT_MS = 45e3;
|
|
10074
10075
|
async function verifyDaemonRestarted(prevPid) {
|
|
10075
|
-
const
|
|
10076
|
+
const start = Date.now();
|
|
10077
|
+
const deadline = start + DAEMON_RESTART_TIMEOUT_MS;
|
|
10076
10078
|
let lastSeen = null;
|
|
10077
10079
|
while (Date.now() < deadline) {
|
|
10078
10080
|
const pid = await readDaemonPid();
|
|
10079
|
-
if (pid !== null && pid !== prevPid && processAlive(pid))
|
|
10081
|
+
if (pid !== null && pid !== prevPid && processAlive(pid)) {
|
|
10082
|
+
const elapsedMs = Date.now() - start;
|
|
10083
|
+
if (elapsedMs > 1e4) {
|
|
10084
|
+
console.log(`Daemon came online after ${Math.round(elapsedMs / 1e3)}s.`);
|
|
10085
|
+
}
|
|
10086
|
+
return pid;
|
|
10087
|
+
}
|
|
10080
10088
|
lastSeen = pid;
|
|
10081
10089
|
await sleep(250);
|
|
10082
10090
|
}
|
|
10083
10091
|
throw new Error(
|
|
10084
|
-
`Daemon restart did not complete within
|
|
10092
|
+
`Daemon restart did not complete within ${Math.round(DAEMON_RESTART_TIMEOUT_MS / 1e3)}s (prevPid=${prevPid ?? "none"}, lastSeenPid=${lastSeen ?? "none"}). Check the daemon log under ~/.appostle/daemon.log or the supervisor's log.`
|
|
10085
10093
|
);
|
|
10086
10094
|
}
|
|
10087
10095
|
async function installAutostart() {
|