Search code examples
ruby-on-railsrubyherokuworker

Can we have two workers with different jobs in Procfile for Heroku?


I have the following in my Procfile:

worker: rake sf:subscribe
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
worker: bundle exec sidekiq

How can I have the above config?

Currently when I push my code on Heroku, the first worker task (rake sf:subscribe) is ignored.

Is there any other way to do that?


Solution

  • Only the web process is 'hard coded' as it were - you can call your other processes whatever you want, eg worker1 and worker2, then start with heroku ps:scale worker1=1 and heroku ps:scale worker2=1