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

Can we set max_attempt at the Job or Queue level? [This is a question - not an issue] #1201

Open
niick7 opened this issue Jan 26, 2024 · 0 comments

Comments

@niick7
Copy link

niick7 commented Jan 26, 2024

Hi Team,

Is there any way that we can set the max_attempt at the Job or Queue level like this:

  1. Job level:
class WelcomeMessageJob
  def perform
    ...
  end

  def max_attempts
    **any_number**
  end

  def queue_name
    'welcome_message_queue'
  end
end
  1. Queue level:
Delayed::Worker.max_attempts = 3
Delayed::Worker.queue_attributes = {
  welcome_message_queue: { priority: -20, max_attempts: **any_number** },
  user_sessions_queue: { priority: -15, max_attempts: **any_number** }
}

Hope to hear from you soon,

Thanks

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

No branches or pull requests

1 participant