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

Set Sidekiq retries to 3 even for ActionMailer::MailDeliveryJob #144

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

floehopper
Copy link
Member

ActionMailer::MailDeliveryJob inherits from ActiveJob::Base; not from ApplicationJob. I suspect that's why the retry option in ApplicationJob didn't seem to be having any effect on jobs created by sending an email.

It's hard to get a definitive answer, but I'm fairly confident setting the retry option on Sidekiq.default_job_options should apply globally to all jobs sent to Sidekiq, i.e. including ActionMailer::MailDeliveryJob.

Fixes #143 (hopefully!🤞)

`ActionMailer::MailDeliveryJob` inherits from `ActiveJob::Base` [1]; not
from `ApplicationJob`. I suspect that's why the retry option in
`ApplicationJob` didn't seem to be having any effect on jobs created by
sending an email.

It's hard to get a definitive answer, but I'm fairly confident setting
the `retry` option on `Sidekiq.default_job_options` should apply
globally to all jobs sent to Sidekiq, i.e. including
`ActionMailer::MailDeliveryJob`.

Fixes #143 (hopefully!🤞)

[1]: https://github.com/rails/rails/blob/23938052acd773fa24068debe56cd892cbf8d868/actionmailer/lib/action_mailer/mail_delivery_job.rb#L13
@floehopper floehopper merged commit 44ca9c7 into main Jan 10, 2024
2 checks passed
@floehopper floehopper deleted the global-sidekiq-retries branch January 10, 2024 22:28
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.

Investigate why mailer jobs don't seem to respect sidekiq_options retry: 3 in ApplicationJob
1 participant