I am having trouble getting my dynos to run multiple delayed job worker processes.
My Procfile looks like this:
worker: bundle exec script/delayed_job -n 3 start
and my delayed_job
script is the default provided by the gem:
#!/usr/bin/env ruby
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
require 'delayed/command'
Delayed::Command.new(ARGV).daemonize
When I try to run this either locally or on a Heroku dyno it exits silently and I can't tell what is going on.
foreman start
16:09:09 worker.1 | started with pid 75417
16:09:15 worker.1 | exited with code 0
16:09:15 system | sending SIGTERM to all processes
SIGTERM received
Any help with either how to debug the issue or suggestions about other ways to go about running multiple workers on a single dyno it would be greatly appreciated.
Try changing your Procfile to:
worker: bundle exec script/delayed_job -n 3 run
Using start
will create two daemons in the background and then immediately exit. Heroku thinks that your process crashed.
Using run
keeps the workers in the foreground.
UPDATE: I use Delayed Job Worker Pool for this now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With