Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActiveJob deliver_later not sending

I have the following method:

UserMailer.comment_alert(@comment, user, type).deliver_later

Which oddly shows up with the param deliver_now in the rails log:

[ActiveJob] Enqueued ActionMailer::DeliveryJob (Job ID: 5bdf9ed1-53d5-42aa-acb2-7ce54ab284e1) to Sidekiq(mailers) with arguments: "UserMailer", "comment_alert", "deliver_now", gid://xxx/Comment/153, gid://xxx/User/26, "Comment"

The job never processes, and I see nothing in the Sidekiq log. There is also no mail delivered, ever. I tried restarting sidekiq, rails, and redis, and even clearing the redis db. Interestingly changing to .deliver_now works, but this doesn't seem to touch sidekiq or create an Enqueued ActionMailer::DeliveryJob

In my application.rb:

config.active_job.queue_adapter = :sidekiq

I am using rails 4.2.6 with activejob 4.2.6

like image 243
Abram Avatar asked Jun 17 '16 01:06

Abram


1 Answers

Mailers are queued in the queue mailers. Remember to start sidekiq processing that queue:

bundle exec sidekiq -q default -q mailers

Or add config/sidekiq.yml with the following content

  :verbose: true
  :concurrency: 25
  :queues:
    - [mailers, 7]
    - [default, 5]

And run bundle exec sidekiq -C config/sidekiq.yml

like image 176
Kenny Chan Avatar answered Oct 22 '22 11:10

Kenny Chan