resque/resque-scheduler

Proper place for settings

thisismydesign opened this issue · 0 comments

I was following the documentation and set up the rake task as usual:

 # https://github.com/resque/resque-scheduler#rake-integration
require 'resque/scheduler/tasks'
namespace :resque do
  task setup_schedule: :setup do
    require 'resque-scheduler'

     Resque::Scheduler.dynamic = true
  end

   task scheduler: :setup_schedule
end

The app has a

  • web servive running rails and also resque-web + scheduler additions
  • worker process
  • scheduler process

The app schedules dynamic jobs from the web and worker services. The ones scheduled from the web service seem fine but he ones scheduled from the worker service:

  • don't show up in the web view (they actually do after deactivating another which I have no clue why)
  • don't show up in Resque.schedule response
  • but otherwise are scheduled and running

Also for the web service the delete buttons are not showing up for the dynamic schedules.

It seems that this is caused by services not having the Resque::Scheduler.dynamic = true setting. Moving this line into config/initializers/resque.rb resolves the issue.

I think this should be documented.