Skip to content

Remove DelayedJob worker and deliver mailers synchronously#620

Merged
fwuensche merged 1 commit into
mainfrom
fwuensche/heroku-worker
Apr 20, 2026
Merged

Remove DelayedJob worker and deliver mailers synchronously#620
fwuensche merged 1 commit into
mainfrom
fwuensche/heroku-worker

Conversation

@fwuensche

Copy link
Copy Markdown
Contributor

Summary

  • All async work in the app was 4 mailer deliveries on low-traffic paths (sign-in welcome, authorization request/grant/alert). Switch them to deliver_now, drop delayed_job_active_record, remove the worker dyno from Procfile, and drop the delayed_jobs table.
  • Swap development to letter_opener so emails preview in the browser; remove perform_deliveries = false from test.rb so assert_emails can see deliveries (delivery_method = :test still prevents real SMTP).
  • Updates affected tests to assert on ActionMailer::Base.deliveries instead of enqueued_jobs.

Post-merge action

Run `heroku ps:scale worker=0 --app cherrypush-production` to retire the worker formation (~$7/mo saved).

Test plan

  • `bin/ci` passes (one pre-existing flaky system test unrelated to this change)
  • Verify a sign-in in dev opens a welcome email in the browser via letter_opener
  • After deploy, scale worker to 0 and confirm emails still deliver

🤖 Generated with Claude Code

All async work in the app was mailer deliveries on low-traffic paths
(sign-in welcome, authorization request/grant/alert). Switch them to
deliver_now, drop the delayed_job_active_record gem, remove the worker
dyno from the Procfile, and drop the delayed_jobs table.

Also swap development to letter_opener so emails preview in the browser,
and remove perform_deliveries=false from test.rb so assert_emails can
see deliveries (delivery_method=:test still prevents real SMTP).

After merge, run: heroku ps:scale worker=0 --app cherrypush-production

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@fwuensche fwuensche merged commit a4505b9 into main Apr 20, 2026
2 checks passed
@fwuensche fwuensche deleted the fwuensche/heroku-worker branch April 20, 2026 13:38
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.

1 participant