Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

queue.add options gets overriden by defaultJobOptions #1904

Closed
otaviosoares opened this issue Nov 14, 2020 · 2 comments
Closed

queue.add options gets overriden by defaultJobOptions #1904

otaviosoares opened this issue Nov 14, 2020 · 2 comments

Comments

@otaviosoares
Copy link

I have a code like the following and I expected the options passed to queue.add to have priority over queue's defaultJobOptions. However, as for now, if you have an option on defaultJobOptions it will always override anything you have in your add call. This was very confusing and it took me some time to figure out why it wasn't working.

const queue = new Queue('test', {
  defaultJobOptions: {delay: 10000 } 
});
queue.add('job', {}, { delay: 1000 });
@swayam18
Copy link

We have the same issue. Default job options are being treated as 'mandatory' job options, which is semantically incorrect

@swayam18
Copy link

The regression was introduced here: ac2fc51#diff-afa7a0a70da4b0fa42349adcdb862c6f079f980b4051ca651d929290f34a29c7L706-R705

A temporary workaround is to revert back to bull 3.15.x, but you might have to deal with bugs that were fixed in newer branches

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants