orbit-basic/config/initializers/resque.rb

15 lines
508 B
Ruby

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]