I performed a small rake task that restarts the task job again and again:
desc "Start a delayed_job worker in a endless loop to prevent exits." task :jobs => :environment do while true begin Delayed::Worker.new(:min_priority => ENV['MIN_PRIORITY'], :max_priority => ENV['MAX_PRIORITY'], :quiet => false).start rescue Exception => e puts "Exception occured (#{e})" end puts "Task jobs:work exited, clearing queue and restarting" sleep 1 Delayed::Job.delete_all end end
Apparently, this did not work. So I ended up with this simple solution:
for (( ;; )); do rake jobs:work --trace; done
source share