From 010e766524b66a9e6d39aac8501c9d151426fbd1 Mon Sep 17 00:00:00 2001 From: Franz Unger Date: Fri, 13 Oct 2023 09:31:37 +0200 Subject: [PATCH] Change backoff-time to 10s --- .changeset/grumpy-peaches-hang.md | 5 +++++ src/daemon-command/script.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/grumpy-peaches-hang.md diff --git a/.changeset/grumpy-peaches-hang.md b/.changeset/grumpy-peaches-hang.md new file mode 100644 index 0000000..cb58dbe --- /dev/null +++ b/.changeset/grumpy-peaches-hang.md @@ -0,0 +1,5 @@ +--- +"@comet/dev-process-manager": minor +--- + +Change maximum backoff time from 30s to 10s diff --git a/src/daemon-command/script.ts b/src/daemon-command/script.ts index 79fecb9..8f41934 100644 --- a/src/daemon-command/script.ts +++ b/src/daemon-command/script.ts @@ -141,7 +141,7 @@ export class Script { this.handleLogs(`[dev-pm] process crashed, restarting...`); this.restartCount++; this.status = "backoff"; - const waitTime = Math.min(Math.pow(1.3, this.restartCount), 30); + const waitTime = Math.min(Math.pow(1.3, this.restartCount), 10); this.handleLogs(`[dev-pm] waiting ${Math.round(waitTime)}s between restarts`); await new Promise((r) => setTimeout(r, waitTime * 1000)); if (this.status == "backoff") {