mattgibson / resque-scheduler-web

Tabs in the Resque Web gem for the Resque Scheduler plugin.
https://rubygems.org/gems/resque-scheduler-web
MIT License
25 stars 24 forks source link

Don't read correctly Resque::Scheduler.dynamic #8

Open ciaoben opened 8 years ago

ciaoben commented 8 years ago

I have simply installed the gem as the README says, and this is my configuration of Resque::Schedule

task "resque:setup_schedule" => "resque:setup" do
  require 'resque-scheduler'
  Resque::Scheduler.dynamic = true
end

task "resque:scheduler" => "resque:setup_schedule"

But resque-scheduler-web behaves like Resque::Scheduler is not set on dynamic. Looking at the code I see the it read the Resque::Scheduler.dynamic (for example in the index view of the scheduler page), and in my case it reads it as it is false. But scheduler is set up correctly, I can see that it dynamically schedules the jobs.

Why scheduler-web can't read it right? What it could be?

ciaoben commented 8 years ago

As you can see here, when using a dynamic scheduler with a rails application, it is needed to set Resque::Scheduler.dynamic in the initializers of the rails app.

I know this gem is not designed to be used only on rails, but I think that it should be a pretty common use case, maybe it is worth mentioning in the README