You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{Worker}from'bullmq';constworker=newWorker('foo',asyncjob=>{// Will print { foo: 'bar'} for the first job// and { qux: 'baz' } for the second.console.log(job.data);});
But that runs into this error, Worker requires a connection.
The simplest possible worker might look more like:
import{Worker}from"bullmq";import{Redis}from"ioredis";constconnection=newRedis({maxRetriesPerRequest: null});constworker=newWorker("foo",async(job)=>{// Will print { foo: 'bar'} for the first job// and { qux: 'baz' } for the second.console.log(job.data);},{ connection },);
A related note is that the documentation given in the connections docs doesn't run:
import{Queue,Worker}from"bullmq";importIORedisfrom"ioredis";constconnection=newIORedis();// Reuse the ioredis instanceconstmyQueue=newQueue("myqueue",{ connection });constmyWorker=newWorker("myqueue",async(job)=>{},{ connection });
Throws Error: BullMQ: Your redis options maxRetriesPerRequest must be null.
Version
5.21.0
Platform
NodeJS
What happened?
The docs say to start with:
But that runs into this error,
Worker requires a connection
.The simplest possible worker might look more like:
A related note is that the documentation given in the connections docs doesn't run:
Throws
Error: BullMQ: Your redis options maxRetriesPerRequest must be null.
Tested with bullmq 5.21.0 and ioredis 5.4.1:
How to reproduce.
No response
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: