delayed_job update query is running infinitely

后端 未结 4 746
面向向阳花
面向向阳花 2021-02-13 12:55

I am using delayed_job and delayed_job_active_record for back ground job execution in my rails application. We are using queue based delayed_job. For starting the delayed I am u

4条回答
  •  心在旅途
    2021-02-13 13:09

    I think what you meant is that delayed_job polls too frequently (which by the way is every 5 seconds by default) - I know that fills up your log, and seems "infinite".. :)

    If that is what you meant, then I suggest you run the workless gem. It will only start delayed_job on a per need basis. Many people use it to keep their Heroku worker dynos from running idle, but it works just as well in development mode.

    Note that if you are using delayed_job_active_record, you also need to add gem 'daemons' to your Gemfile (daemons). See the Running Jobs section of delayed_job.

    Thus, your Gemfile would contain:

    gem 'delayed_job_active_record'
    gem 'daemons'
    gem 'workless'
    

    If you need more guidance, let me know in the comments below.

提交回复
热议问题