Orbit/config/initializers/resque.rb

21 lines
814 B
Ruby
Raw Permalink Normal View History

2012-05-07 02:23:16 +00:00
require 'resque_scheduler'
# require 'resque_scheduler/server'
# require 'yaml'
2012-04-13 04:10:47 +00:00
2012-05-07 02:23:16 +00:00
Resque.redis = 'localhost:6379'
#Resque.redis.namespace = "resque:SchedulerExample"
2012-04-13 04:10:47 +00:00
2012-05-07 02:23:16 +00:00
# If you want to be able to dynamically change the schedule,
# uncomment this line. A dynamic schedule can be updated via the
# Resque::Scheduler.set_schedule (and remove_schedule) methods.
# When dynamic is set to true, the scheduler process looks for
# schedule changes and applies them on the fly.
# Note: This feature is only available in >=2.0.0.
#Resque::Scheduler.dynamic = true
2012-04-13 04:10:47 +00:00
Dir["#{Rails.root}/app/jobs/*.rb"].each { |file| require file }
2012-05-07 02:23:16 +00:00
# The schedule doesn't need to be stored in a YAML, it just needs to
# be a hash. YAML is usually the easiest.
Resque.schedule = YAML.load_file(Rails.root.join('config', 'resque_schedule.yml'))