Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Commit

Permalink
fix remove worker
Browse files Browse the repository at this point in the history
  • Loading branch information
batamar committed Apr 15, 2020
1 parent 83c903a commit deefe38
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions engages-email-sender/src/workers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ export const createWorkers = (workerPath: string, workerData: any, results: stri
removeWorker(worker);
});

worker.on('message', msg => {
if (msg === 'Successfully finished job') {
removeWorker(worker);
}
});

worker.on('exit', code => {
if (code !== 0) {
debugWorkers(`Worker stopped with exit code ${code}`);
Expand Down

0 comments on commit deefe38

Please sign in to comment.