Skip to content

Instantly share code, notes, and snippets.

@MatthieuSegret
Created May 24, 2012 12:31
Show Gist options
  • Save MatthieuSegret/2781314 to your computer and use it in GitHub Desktop.
Save MatthieuSegret/2781314 to your computer and use it in GitHub Desktop.
ENV["REDISTOGO_URL"] ||= "redis://localhost:6379/"
uri = URI.parse(ENV["REDISTOGO_URL"])
Resque.redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
Resque.after_fork = Proc.new { ActiveRecord::Base.establish_connection }
Dir["#{Rails.root}/app/jobs/*.rb"].each { |file| require file }
require 'resque/server'
#TODO Add Devise Authentication
# cf http://blog.kiskolabs.com/post/776939029/rails3-resque-devise
#
# class Authentication
# def initialize(app)
# @app = app
# end
#
# def call(env)
# env['warden'].authenticate!(:database_authenticatable, :rememberable, :scope => :admin)
# @app.call(env)
# end
#end
#
#Resque::Server.use Authentication
Resque::Server.new
Resque.after_fork = Proc.new { ActiveRecord::Base.establish_connection }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment