0

I am working on a project that has a web server written in RubyonRails. Another person started the code for this project and I got all the code. This server used delayed_job. The production server is running fine without any problem. However, when I want run it on my local server, none of the delayed_job tasks run. I do not get any error, for example, when I run rake jobs:work on my local server, and I submit a job, this is the output:

[Worker(host:ardrossan pid:20474)] Starting job worker

[Worker(host:ardrossan pid:20474)] Job Delayed::PerformableMethod (id=2) RUNNING

[Worker(host:ardrossan pid:20474)] 1 jobs processed at 17.9446 j/s, 0 failed

But no results is generated. Any advice on how I can get the delayed_jobs working on my local server is appreciated.

I should mention that I am using 'rails', '3.2.17' and my OS is Ubuntu 12.04.4 LTS

2 Answers2

0

think you have to launch the background workers locally using foreman. The following worked on my Mac.

From Heroku docs:

You then need to tell your application to process jobs put into your job queue, you can do that by adding this to your Procfile:

worker:  bundle exec rake jobs:work

Now when you start your application using Foreman it will start processing your job queue.

foreman start

Having said all that, unless you are deploying on a Mac, it doesn't really matter if they run locally. (I noticed this after I got it working.) It only matters if it works on your servers. If you are deploying on Heroku, then Delayed Job works well.

Reference:

https://devcenter.heroku.com/articles/delayed-job https://devcenter.heroku.com/articles/procfile http://blog.daviddollar.org/2011/05/06/introducing-foreman.html
https://github.com/ddollar/foreman

jimagic
  • 4,045
  • 2
  • 28
  • 49
0

Youll need to start by yourself since you do not have any workers to trigger your actions by itself.

Hamdan
  • 183
  • 15