@nmakarov/cli-toolkit 0.78.0 → 0.79.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/index.js CHANGED
@@ -6320,6 +6320,12 @@ function resolveKillTimeoutMs(pm2) {
6320
6320
  if (Number.isFinite(stopSec) && stopSec > 0) return Math.floor(stopSec * 1e3) + 5e3;
6321
6321
  return 65e3;
6322
6322
  }
6323
+ var DEFAULT_KILL_RETRY_TIME_MS = 1e4;
6324
+ function resolveKillRetryTimeMs(pm2) {
6325
+ const explicit = Number(pm2?.killRetryTime);
6326
+ if (Number.isFinite(explicit) && explicit > 0) return Math.floor(explicit);
6327
+ return DEFAULT_KILL_RETRY_TIME_MS;
6328
+ }
6323
6329
  function resolvePm2Args(pm2) {
6324
6330
  const base = String(pm2?.args ?? "").trim();
6325
6331
  const stopSec = Number(pm2?.stopAllowance);
@@ -6343,6 +6349,7 @@ function buildEcosystemConfig(service, paths) {
6343
6349
  const outLog = join9(paths.logs, `${pm2.appName}.out.log`);
6344
6350
  const errLog = join9(paths.logs, `${pm2.appName}.err.log`);
6345
6351
  const killTimeoutMs = resolveKillTimeoutMs(pm2);
6352
+ const killRetryTimeMs = resolveKillRetryTimeMs(pm2);
6346
6353
  const args = resolvePm2Args(pm2);
6347
6354
  const ensureEnv = paths.ensureEnv;
6348
6355
  return `/**
@@ -6368,6 +6375,9 @@ module.exports = {
6368
6375
  max_memory_restart: "1500M",
6369
6376
  // Grace window after SIGINT/SIGTERM before SIGKILL (ms). Align with --stopAllowance.
6370
6377
  kill_timeout: ${killTimeoutMs},
6378
+ // How often pm2 re-checks / logs "failed to kill - retrying in \u2026"
6379
+ // while waiting for graceful exit (pm2 default 100ms \u2192 noisy logs).
6380
+ kill_retry_time: ${killRetryTimeMs},
6371
6381
  out_file: "${outLog}",
6372
6382
  error_file: "${errLog}",
6373
6383
  merge_logs: true,