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
Bull is smart enough not to add the same repeatable job if the repeat options are the same.
But in reality, it seems not to work as expected. For example here is my code of job, I want to run every hour.
exportconstgetWorker: WorkerFactoryFn=(ctx)=>{consthourInMs=60*60*1000;constname=WorkerQueueName.NAME;constqueue=newQueue(name,{connection: ctx.redis,});return{
name,workers: times(1,()=>newWorker<undefined,void>(name,workerHandler(name,ctx),{connection: ctx.redis,concurrency: 1,// The rate limiter is global, so if you have for example 10 workers// for one queue with the above settings, still only 10 jobs will be processed by second.limiter: {max: 1,duration: hourInMs},})),queueScheduler: newQueueScheduler(name,{connection: ctx.redis,}),
queue,creator: {add: ()=>queue.add(name,{},{repeat: {cron: "0 * * * * *",jobId: name},jobId: name}),},};};
Checking it with documentation and source code, it seems this should be enough (don't mind multiple jobId, I was trying multiple solutions).
/** * Override the job ID - by default, the job ID is a unique * integer, but you can use this setting to override it. * If you use this option, it is up to you to ensure the * jobId is unique. **If you attempt to add a job with an id that * already exists, it will not be added.** */
jobId?: string;
In documentation (https://docs.bullmq.io/guide/jobs/repeatable) it says:
But in reality, it seems not to work as expected. For example here is my code of job, I want to run every hour.
Checking it with documentation and source code, it seems this should be enough (don't mind multiple jobId, I was trying multiple solutions).
While in reality
creates multiple delayed jobs.
What am I missing?
The text was updated successfully, but these errors were encountered: