delayed_job queue not being processed on Heroku

后端 未结 4 471
暖寄归人
暖寄归人 2021-01-23 02:14

I\'m running a Rails 3 app with delayed_job. The issue I\'ve come across is that though the app is correctly adding jobs to the queue, they are never being processed.

相关标签:
4条回答
  • 2021-01-23 02:53

    In the end, the problem turned out to be a bug in Rake 0.9.0. As Rails depends on Rake, running bundle install after this release of Rake broke my delayed jobs.

    The fix is to add gem 'rake', '0.8.7' to your gemfile.

    More details can be found below...

    DHH's tweet: http://twitter.com/dhh/status/71966528744071169

    Discussion in rails_admin's issue tracker: https://github.com/sferik/rails_admin/issues/428

    0 讨论(0)
  • 2021-01-23 02:58

    Two options for you:

    These two gems watch delayed_jobs queue and automatically 'hires' background workers to process the thread:

    • Option 1: https://github.com/michelson/hirefire (This is what I am using because it supports mongoid)
    • Option 2: This branch of delayed_job developed by a heroku engineer has a similar autoscale feature: https://github.com/pedro/delayed_job/tree/autoscaling

    Good luck

    0 讨论(0)
  • 2021-01-23 02:59

    Are you running the delayed_job daemon in the same environment in which the application is running?

    Try working the jobs manually using:
    rake RAILS_ENV=development jobs:work

    If you are running your app in production mode then you need to start delayed_job daemon as:
    RAILS_ENV=production script/delayed_job start

    0 讨论(0)
  • 2021-01-23 03:03

    This is kinda a long shot but make sure you are using the same Ruby version on Heroku as you are on your local machine. I had a problem with delayed jobs on Heroku before because of this.

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