-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
So it seems there is an easy fix but I just did not know how to:
const worker = new SandboxedWorker<EmailJob>('emails', {
processor: './processor.ts',
concurrency: 5,
heartbeatInterval: 5000,
});
process.on('SIGINT', async () => {
console.log('Shutting down...');
while(true) {
await sleep(1000);
if(worker.getStats().busy === 0) { break; }
}
await worker.stop();
shutdownManager();
process.exit(0);
});this fixes that running jobs are still processed fully
Proposed solution
Update the page: https://bunqueue.dev/guide/use-cases/#graceful-shutdown-patternAlternatives considered
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request