Closed fones closed 6 years ago
Sounds similar to https://github.com/brandonhilkert/sucker_punch/issues/204#issuecomment-328641602.
The process of a rake task shuts down after the tasks are completed, so there's no leftover process for the Sucker Punch workers to be running. When executed from a controller, the controller is still alive allowing the job to finish. If using from rake, it's best to run them synchronously to avoid this.
Rails 2.3.1 Rails 5.0.0.1
Got rake task that is fired at night to check subscriptions in my saas project.
When someone is not paying, we suspend his/her website and send an e-mail.
part of Rake task
website#suspend
And now I get this in my log:
Firt job
SuspendWebsiteJob
is working properly, bot secondWebsitesMailer.notrenewed_website_suspend(admin, id).deliver_later
is enqueued bot not proccessed.I even change the default queue name for ActionMailer from
mailers
todefault
but got the same results:
For now I am using
delivery_now
to workaround this. In rake task its does not matter (now or later).When I start this from controller it works OK, got problemy only when doing this from Rake task.