Closed
Description
Version
5.21.2
Platform
NodeJS
What happened?
According to the docs the immediately option on upsertJobScheduler
kicks in the worker instantly once registered, but once using a cron pattern along with immediately the worker starts processing multiple times in a row, from 20 to 30 times during my tests. As an additional information, according to my tests limit
option actually the kick in.
How to reproduce.
Take the docs sample along with a test worker:
const worker = async () => {
console.log('workkkkkkks again');
};
await myQueue.upsertJobScheduler(
"end-soon-job",
{
every: 60000, // every minute
immediately: true,
},
{
name: "timed-end-job",
opts: {
attempts: 0,
removeOnComplete: 5,
removeOnFail: 20,
},
}
);
Once changing the every
property to cron pattern the worker kicks in multiple times:
await myQueue.upsertJobScheduler(
"end-soon-job",
{
pattern: '* * * * *', // every minute in cron
immediately: true,
},
{
name: "timed-end-job",
opts: {
attempts: 0,
removeOnComplete: 5,
removeOnFail: 20,
},
}
);
Relevant log output
No response
Code of Conduct
- I agree to follow this project's Code of Conduct