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

Add canRetry options to queue #384

Merged
merged 5 commits into from
Feb 19, 2022
Merged

Add canRetry options to queue #384

merged 5 commits into from
Feb 19, 2022

Conversation

jgillick
Copy link
Contributor

@jgillick jgillick commented Feb 18, 2022

For some queues, I'd like to be able to clear jobs but never retry them.

This PR adds a allowRetries option that defaults to true and is superseded by readOnlyMode.

Example

const boardQueues = [new BullMQAdapter(commsQueue, { allowRetries: false })];
createBullBoard({
    serverAdapter: new ExpressAdapter(),
    queues: boardQueues,
});

Use Case
I have a queue responsible for notifications that are only relevant for a short period of time and if they fail, should not be retried. The bull dashboard is available by many people inside my company and I don't want others to accidentally hit the retry button and cause confusion for our users. However, clearing jobs is an important feature to keep.

readOnlyMode
Setting the readOnlyMode option will supersede this option and set allowRetries to false.

@felixmosh
Copy link
Owner

Thank you for this PR

I think that a better name would be allowRetries WDYT?

@jgillick
Copy link
Contributor Author

@felixmosh That sounds good to me. I've updated the PR and added a couple unit tests.

@felixmosh felixmosh merged commit a5d937a into felixmosh:master Feb 19, 2022
@felixmosh
Copy link
Owner

Released in v3.10.0
Thank you for this PR 🙏🏼

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 this pull request may close these issues.

2 participants