@nextnode-solutions/nn 1.1.5 → 1.1.6
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/index.js +18 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20786,24 +20786,23 @@ function gracefulKill(proc, timeoutMs = 5e3) {
|
|
|
20786
20786
|
});
|
|
20787
20787
|
}
|
|
20788
20788
|
async function waitForHealthy(checkFn, label, maxMs = 6e4) {
|
|
20789
|
-
|
|
20790
|
-
let
|
|
20791
|
-
|
|
20792
|
-
while (
|
|
20789
|
+
const start = Date.now();
|
|
20790
|
+
let nextLog = start;
|
|
20791
|
+
consola.info(`Waiting for ${label} to become healthy...`);
|
|
20792
|
+
while (Date.now() - start < maxMs) {
|
|
20793
20793
|
if (checkFn()) {
|
|
20794
20794
|
consola.success(`${label} healthy`);
|
|
20795
20795
|
return true;
|
|
20796
20796
|
}
|
|
20797
|
-
|
|
20798
|
-
|
|
20797
|
+
const now = Date.now();
|
|
20798
|
+
if (now >= nextLog) {
|
|
20799
|
+
const remaining = Math.ceil((maxMs - (now - start)) / 1e3);
|
|
20799
20800
|
consola.info(
|
|
20800
|
-
`
|
|
20801
|
+
`Still waiting for ${label}... (${remaining}s remaining)`
|
|
20801
20802
|
);
|
|
20802
|
-
|
|
20803
|
+
nextLog = now + 1e4;
|
|
20803
20804
|
}
|
|
20804
|
-
await sleep(
|
|
20805
|
-
elapsed += delay;
|
|
20806
|
-
delay = Math.min(delay * 2, 4e3);
|
|
20805
|
+
await sleep(2e3);
|
|
20807
20806
|
}
|
|
20808
20807
|
consola.warn(`${label} did not become healthy within ${maxMs / 1e3}s`);
|
|
20809
20808
|
return false;
|
|
@@ -20913,9 +20912,15 @@ function ensureGitignore(projectDir) {
|
|
|
20913
20912
|
function allServicesHealthy(composePath) {
|
|
20914
20913
|
const statuses = getServiceStatuses(composePath);
|
|
20915
20914
|
if (statuses.length === 0) return false;
|
|
20916
|
-
|
|
20917
|
-
(s2) => s2.state
|
|
20915
|
+
const unhealthy = statuses.filter(
|
|
20916
|
+
(s2) => s2.state !== "running" || s2.health !== "" && s2.health !== "healthy"
|
|
20918
20917
|
);
|
|
20918
|
+
if (unhealthy.length > 0) {
|
|
20919
|
+
consola.debug(
|
|
20920
|
+
`Not ready: ${unhealthy.map((s2) => `${s2.name}(state=${s2.state},health=${s2.health})`).join(", ")}`
|
|
20921
|
+
);
|
|
20922
|
+
}
|
|
20923
|
+
return unhealthy.length === 0;
|
|
20919
20924
|
}
|
|
20920
20925
|
function printStartupSummary(composePath, services, ports) {
|
|
20921
20926
|
console.log("");
|