@atolis-hq/wake 0.2.9 → 0.2.10
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.
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { waitForActiveRuns } from './stop-command.js';
|
|
2
2
|
const HEALTHCHECK_WAKE_ROOT = '/tmp/wake-self-update-healthcheck';
|
|
3
|
+
const START_PROCESS_CHECK_ATTEMPTS = 15;
|
|
4
|
+
const START_PROCESS_CHECK_INTERVAL_MS = 1000;
|
|
3
5
|
const START_PROCESS_CHECK = [
|
|
4
6
|
'sh',
|
|
5
7
|
'-lc',
|
|
@@ -28,8 +30,22 @@ async function verifyResidentStart(input) {
|
|
|
28
30
|
input.logger.error(`[self-update] wake start auto-start is disabled; resident loop will not be running after ${input.context}`);
|
|
29
31
|
return;
|
|
30
32
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
let lastError;
|
|
34
|
+
for (let attempt = 1; attempt <= START_PROCESS_CHECK_ATTEMPTS; attempt += 1) {
|
|
35
|
+
try {
|
|
36
|
+
await input.docker.exec(input.containerName, START_PROCESS_CHECK);
|
|
37
|
+
input.logger.info(`[self-update] verified wake start is running after ${input.context}`);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
lastError = error;
|
|
42
|
+
if (attempt === START_PROCESS_CHECK_ATTEMPTS) {
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
await input.sleep(START_PROCESS_CHECK_INTERVAL_MS);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
throw lastError instanceof Error ? lastError : new Error(String(lastError));
|
|
33
49
|
}
|
|
34
50
|
export async function runSelfUpdateCommand(input) {
|
|
35
51
|
const force = hasFlag('--force', input.args);
|
|
@@ -76,6 +92,7 @@ export async function runSelfUpdateCommand(input) {
|
|
|
76
92
|
containerName: input.containerName,
|
|
77
93
|
start: input.start,
|
|
78
94
|
logger: input.logger,
|
|
95
|
+
sleep: input.sleep,
|
|
79
96
|
context: 'rollout',
|
|
80
97
|
});
|
|
81
98
|
await input.docker.exec(input.containerName, [
|
|
@@ -99,6 +116,7 @@ export async function runSelfUpdateCommand(input) {
|
|
|
99
116
|
containerName: input.containerName,
|
|
100
117
|
start: input.start,
|
|
101
118
|
logger: input.logger,
|
|
119
|
+
sleep: input.sleep,
|
|
102
120
|
context: 'rollback',
|
|
103
121
|
});
|
|
104
122
|
input.logger.info(`[self-update] rolled back to ${ledger.lastKnownGoodTag}`);
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const wakeVersion = "0.2.
|
|
1
|
+
export const wakeVersion = "0.2.10+gc34a38e";
|