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

fix: prefer custom backoff strategy to built-in if provided #2277

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lbennett-stacki
Copy link

@lbennett-stacki lbennett-stacki commented Nov 11, 2023

This feels a bit easier to reason over to me, my thinking is...

  1. A queue can define a built-in backoff strategy for use as an always-available default
    a. Queues no longer define their own custom strategies. Related to docs: delete page for now removed backoffStrategies Queue settings #2275 and fix: narrow the BackoffOptions "type" union #2276
  2. A worker can define its own backoff strategy on that/any queue and the custom strategy will be preferred

Maybe a future piece could be to unify the backoff settings for both queues and workers. Or deciding one place to define it.

if (backoff.type in Backoffs.builtinStrategies) {
return Backoffs.builtinStrategies[backoff.type](backoff.delay!);
} else if (customStrategy) {
if (customStrategy) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this means that you want to have the possibility to override a builtin strategy? that's the only case that came into my mind, but it would be the same as defining a customFixed strategy or a customExponential one, also probably more people is using the default ones

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.

None yet

2 participants