Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Sidekiq working on Heroku?

It's my first attempt to get Redis working on Heroku.

I've added one worker dyno (just today, so didn't pay yet), added RedisToGo Nano add-on, tested background jobs on my local machine, and pushed the app to heroku.

heroku ps

gives

=== web: `bundle exec rails server -p $PORT`
web.1: up 2013/03/03 18:26:09 (~ 37m ago)

=== worker: `bundle exec rake jobs:work`
worker.1: crashed 2013/03/03 19:02:15 (~ 1m ago)

Sidekiq Web Interface says that one job is enqueued, but zero processed or failed.

I'm guessing it's because my worker dyno is crashed.

Are there any noob mistakes that I don't know about?

(e.g. I need to run some command to start listening to background jobs etc)

heroku logs --tail doesn't show any errors, so I don't understand why my worker dyno chashes.

like image 905
Serge Vinogradoff Avatar asked Mar 03 '13 17:03

Serge Vinogradoff


1 Answers

I did some research and fixed it like this:

Under app's root directory I created a file called "Procfile" with this content:

web: bundle exec rails server -p $PORT
worker: bundle exec sidekiq -c 5 -v

Got this idea from here.

After that it worked ok.

like image 132
Serge Vinogradoff Avatar answered Oct 02 '22 15:10

Serge Vinogradoff