@nmakarov/cli-toolkit 0.51.0 → 0.55.0
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-runner.cjs +23 -12
- package/dist/cli-runner.cjs.map +1 -1
- package/dist/cli-runner.js +23 -12
- package/dist/cli-runner.js.map +1 -1
- package/dist/deploy.cjs +234 -16
- package/dist/deploy.cjs.map +1 -1
- package/dist/deploy.js +221 -10
- package/dist/deploy.js.map +1 -1
- package/dist/index.cjs +246 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +231 -18
- package/dist/index.js.map +1 -1
- package/dist/init.cjs +14 -5
- package/dist/init.cjs.map +1 -1
- package/dist/init.js +14 -5
- package/dist/init.js.map +1 -1
- package/dist/tasks.cjs +10 -8
- package/dist/tasks.cjs.map +1 -1
- package/dist/tasks.js +10 -8
- package/dist/tasks.js.map +1 -1
- package/package.json +1 -1
- package/scripts/deploy/cli.js +5 -1
package/dist/init.cjs
CHANGED
|
@@ -2648,7 +2648,10 @@ async function init(flow, opts = {}) {
|
|
|
2648
2648
|
context.isStop = () => stop;
|
|
2649
2649
|
context = await setupModules(context, opts);
|
|
2650
2650
|
const stopAfter = context.args.get("stopAfter");
|
|
2651
|
-
const
|
|
2651
|
+
const stopAllowanceSec = Number(context.params.get("stopAllowance", "number default 60"));
|
|
2652
|
+
const stopAllowanceMs = (Number.isFinite(stopAllowanceSec) && stopAllowanceSec >= 0 ? stopAllowanceSec : 60) * 1e3;
|
|
2653
|
+
context.stopAllowanceSec = stopAllowanceSec;
|
|
2654
|
+
context.stopAllowanceMs = stopAllowanceMs;
|
|
2652
2655
|
if (stopAfter === "init") {
|
|
2653
2656
|
printAllParameters(context);
|
|
2654
2657
|
process.exit(0);
|
|
@@ -2662,8 +2665,10 @@ async function init(flow, opts = {}) {
|
|
|
2662
2665
|
sigintCount = 1;
|
|
2663
2666
|
firstSigintAt = now;
|
|
2664
2667
|
stop = true;
|
|
2665
|
-
context.logger.info(
|
|
2666
|
-
|
|
2668
|
+
context.logger.info(
|
|
2669
|
+
`>> emitting stop with allowance ${stopAllowanceSec}s (${stopAllowanceMs}ms)`
|
|
2670
|
+
);
|
|
2671
|
+
context.emitter.emit("stop", stopAllowanceMs);
|
|
2667
2672
|
return;
|
|
2668
2673
|
}
|
|
2669
2674
|
if (now - firstSigintAt < 250) return;
|
|
@@ -2674,8 +2679,10 @@ async function init(flow, opts = {}) {
|
|
|
2674
2679
|
process.on("SIGTERM", () => {
|
|
2675
2680
|
if (!context || stop) return;
|
|
2676
2681
|
stop = true;
|
|
2677
|
-
context.logger.info(
|
|
2678
|
-
|
|
2682
|
+
context.logger.info(
|
|
2683
|
+
`>> SIGTERM: emitting stop with allowance ${stopAllowanceSec}s (${stopAllowanceMs}ms)`
|
|
2684
|
+
);
|
|
2685
|
+
context.emitter.emit("stop", stopAllowanceMs);
|
|
2679
2686
|
});
|
|
2680
2687
|
await flow(context);
|
|
2681
2688
|
} catch (error) {
|
|
@@ -2703,6 +2710,8 @@ async function init(flow, opts = {}) {
|
|
|
2703
2710
|
}
|
|
2704
2711
|
if (process.exitCode && process.exitCode !== 0) {
|
|
2705
2712
|
process.exit(process.exitCode);
|
|
2713
|
+
} else if (stop) {
|
|
2714
|
+
process.exit(0);
|
|
2706
2715
|
}
|
|
2707
2716
|
}
|
|
2708
2717
|
}
|