Add multiple repeatable jobs with the same cron pattern
Created by: Maximization
In my use case I have multiple repeatable jobs with the same cron pattern that are created and removed programatically. I do not know beforehand how many jobs will be at any given time.
According to this line https://github.com/OptimalBits/bull/blob/master/lib/queue.js#L506 the uniqueness of repeatable job keys is determined by the prefix, queue name, 'repeat', job name and cron string. Which means I can only try and differentiate the keys with the queue or job name variables, both for which I need to instantiate separate queue workers to process them. This works well when the jobs are predefined before but is less convenient when jobs are added and removed on the go.
If I try to add multiple jobs with the same cron pattern they get the same key and therefore only one will exist at a given time. JobId seems to not play a role with repeatable jobs.
Is there a way to accomplish this or a workaround for the existing code?