orbit-basic/config/initializers/resque.rb

16 lines
509 B
Ruby
Raw Normal View History

2012-04-13 04:10:47 +00:00
require 'resque_scheduler'
require 'resque_scheduler/server'
require 'yaml'
rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..'
rails_env = ENV['RAILS_ENV'] || 'development'
resque_config = YAML.load_file(rails_root + '/config/resque.yml')
Resque.redis = resque_config[rails_env]
Resque.schedule = YAML.load_file("#{Rails.root}/config/resque_schedule.yml")
Dir["#{Rails.root}/app/jobs/*.rb"].each { |file| require file }
# current_path = Rails.root.to_s.gsub(/\s/,'\ ')
# queues = [:test]