Ruby on Rails Delayed Job Local Wont Run

后端 未结 1 1594
梦如初夏
梦如初夏 2021-01-13 18:31

I\'m working with delayed job for active record gem https://github.com/collectiveidea/delayed_job I\'m trying to set up a job to run five minutes after an event occurs in m

相关标签:
1条回答
  • 2021-01-13 19:20

    I 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

    0 讨论(0)
提交回复
热议问题