Skip to content

Instantly share code, notes, and snippets.

@rbmrclo
Created May 15, 2014 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbmrclo/0ec05599add0b66bde77 to your computer and use it in GitHub Desktop.
Save rbmrclo/0ec05599add0b66bde77 to your computer and use it in GitHub Desktop.
require 'resque'
require 'resque_scheduler'
require 'resque/server'
require 'resque_scheduler/server'
schedules = YAML.load_file(Rails.root.join('config', 'schedules.yml'))
$redis = Resque.redis = Redis.current = Redis.new( url: ENV['REDIS_URI'] )
Resque.schedule = schedules
Resque.after_fork do
ActiveRecord::Base.establish_connection
$redis = Resque.redis = Redis.current = Redis.new( url: ENV['REDIS_URI'] )
Resque.schedule = schedules
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment