collectiveidea / delayed_job

Database based asynchronous priority queue system -- Extracted from Shopify
http://groups.google.com/group/delayed_job
MIT License
4.82k stars 954 forks source link

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

Closed niick7 closed 3 months ago

niick7 commented 9 months ago

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

albus522 commented 3 months ago

No, there is not