The BullMQ "delayed job not running" error is typically caused by one of two issues:
Delayed Jobs Configuration: First, it's possible that the queue isn't properly set up to handle delayed jobs. In BullMQ, you can specify a delay when adding a job to the queue, but the queue must be correctly configured to process these delayed jobs.
Missing or Misconfigured Event Listener: Another possible cause is if the event listener for 'completed' or 'failed' jobs is missing or misconfigured. The listening event allows you to handle the job once it is processed, but if this is not set up correctly, it could lead to jobs appearing not to run.
Here are possible solutions to fix the "bullmq delayed job not running" error:
const job = await queue.add('myJob', data, { delay: 5000 });
queue.on('completed', (job, result) => { console.log(`Job completed with result ${result}`); }); queue.on('failed', (job, err) => { console.log(`Job failed with error ${err}`); });
Remember, BullMQ relies on Redis, and any issues with your Redis server could also potentially affect the handling of delayed jobs. So, make sure that your connection to Redis is stable and configured correctly.
Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement.