Skip to content

Commit

Permalink
Merge pull request #81 from vivid-planet/backoff-time
Browse files Browse the repository at this point in the history
Change backoff-time to 10s
  • Loading branch information
fraxachun authored Oct 13, 2023
2 parents 58cc967 + 010e766 commit a074a0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/grumpy-peaches-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@comet/dev-process-manager": minor
---

Change maximum backoff time from 30s to 10s
2 changes: 1 addition & 1 deletion src/daemon-command/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down

0 comments on commit a074a0a

Please sign in to comment.