From 2293847a61c37c8b43a73c36caeaad9001fb4508 Mon Sep 17 00:00:00 2001 From: Hexagon Date: Mon, 22 Apr 2024 21:02:44 +0200 Subject: [PATCH] Reset restart count on any kind of manual start --- docs/src/changelog.md | 1 + lib/core/process.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/src/changelog.md b/docs/src/changelog.md index 524d434..febcddb 100644 --- a/docs/src/changelog.md +++ b/docs/src/changelog.md @@ -13,6 +13,7 @@ All notable changes to this project will be documented in this section. - fix(rest): Add `/log` to the rest api - chore(docs): Add Rest API docs. +- fix(core): Reset restart count on any kind of manual start ## [1.0.0-rc.29] - 2024-04-22 diff --git a/lib/core/process.ts b/lib/core/process.ts index 079002c..fa824ad 100644 --- a/lib/core/process.ts +++ b/lib/core/process.ts @@ -181,8 +181,8 @@ class Process { return } - // Do not restart if maximum number of restarts are exhausted - if (this.restarts >= (this.config.restartLimit ?? Infinity)) { + // Do not restart if maximum number of restarts are exhausted and reason is restart + if (this.restarts >= (this.config.restartLimit ?? Infinity) && restart) { logger.log("exhausted", `Maximum number of starts exhausted, refusing to start`, this.config) this.setStatus(ProcessState.EXHAUSTED) return