Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
fix: listen to worker error
Browse files Browse the repository at this point in the history
  • Loading branch information
KagChi committed Feb 21, 2024
1 parent adbef38 commit e82763b
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ export class ProcessShardingStrategy implements IShardingStrategy {
}).catch(error => setTimeout(() => {
this.logger.error(error, "Error when starting worker !");
const worker = this.#workerByShardId.get(workerData.shardIds[0])!;
worker.on("error", error => this.logger.error({ error, shardIds: workerData.shardIds }, "process emitted error !"));
this.#workers.splice(this.#workers.indexOf(worker), 1);
this.restartWorker(workerData);
}, 5_000));
Expand Down

0 comments on commit e82763b

Please sign in to comment.