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

Using concurrency controls with ActionMailer #1385

Open
drale2k opened this issue Jun 27, 2024 · 0 comments
Open

Using concurrency controls with ActionMailer #1385

drale2k opened this issue Jun 27, 2024 · 0 comments

Comments

@drale2k
Copy link

drale2k commented Jun 27, 2024

@bensheldon after your help on Slack i can confirm this works fine and i think adding it to the docs will help others in the future.

config/initializers/good_job.rb

Rails.application.configure do
  ActionMailer::MailDeliveryJob.include GoodJob::ActiveJobExtensions::Concurrency
  ActionMailer::MailDeliveryJob.good_job_control_concurrency_with(
   perform_throttle: [ 2, 2.second ]
  )
end

In my case perform_throttle: [ 1, 1.second ] did not work as expected. It would send more than 1 per second and i would hit the rate limit on the Resend API. 2 in 2 seconds seems to work though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Inbox
Development

No branches or pull requests

1 participant