fix: Implement graceful shutdown for worker and queue scheduler

This commit is contained in:
Faruk AYDIN
2022-05-13 10:22:58 +02:00
parent cc1892a5cf
commit 57186bf85d
2 changed files with 9 additions and 1 deletions

View File

@@ -24,3 +24,7 @@ worker.on('failed', (job, err) => {
`JOB ID: ${job.id} - FLOW ID: ${job.data.flowId} has failed with ${err.message}`
);
});
process.on('SIGTERM', async () => {
await worker.close();
});