Alois

Joined

3,610 Experience
36 Lessons Completed
0 Questions Solved

Activity

It took me some time to understand why my ActionMailer::MailDeliveryJob were getting enqueued but not performed when running the rake task. Reading this article https://stevechanin.blogspot.com/2017/05/deliverlater-not-working-in-rake-tasks.html it seems that using UserMailer#deliver_later puts the job in a memory queue that dies when the rake task ends.
Using UserMailer#deliver_now or putting the rake task to sleep with a sleep(5) at the end of it does help for now.