Skip to content

Commit

Permalink
fix: backoff时间取错了
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbang93 committed Jan 23, 2024
1 parent a613844 commit 550949f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function forkWorker(): void {
console.log(`工作进程 ${worker.id} 异常退出,${backoff}秒后重启`)
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
setTimeout(() => forkWorker(), backoff * 1000)
backoff = Math.max(backoff * BACKOFF_FACTOR, 60)
backoff = Math.min(backoff * BACKOFF_FACTOR, 60)
})
worker.on('ready', () => {
backoff = 1
Expand Down

0 comments on commit 550949f

Please sign in to comment.