简体   繁体   中英

activating resque workers on heroku

My queue "send_comments" on my heroku app shows 12 items but says "0 of 0 Workers Working". I know that if I want to process the job on localhost I use the following line:

QUEUE=send_comments rake resque:work

How do I do this with heroku?

Thank you.

UPDATE

I'm not sure what this error means, but I get it when running "foreman start"

$ foreman start --trace
21:15:38 worker.1  | started with pid 803
21:15:44 worker.1  | rake aborted!
21:15:44 worker.1  | can't convert Float into String
21:15:44 worker.1  | 
21:15:44 worker.1  | Tasks: TOP => resque:work => resque:preload => resque:setup
21:15:44 worker.1  | (See full trace by running task with --trace)

What does this mean and could this be why the workers are not processing?

This is my Procfile:

worker: env RESQUE_TERM_TIMEOUT=1 TERM_CHILD=1 VVERBOSE=1 QUEUE=* bundle exec rake resque:work

The Procfile is just what tells Heroku what to do when you spin up a dyno of a given sort (in this case, the worker). In order to actually create a worker, you'll have to manually scale up the dyno, like this:

$ heroku ps:scale worker=1

This will spin up a dyno, and then run what you specified in the Procfile after worker: , which has the effect of running this rake task on the new dyno. This creates one worker, you can specify as many as you need. This scaling is also independent of stopping/restarting your app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM