Trying to fix resque issue

This commit is contained in:
Dmitriy Zaporozhets 2012-12-25 15:53:50 +02:00
parent c5eba169cd
commit 64db738f9d
2 changed files with 3 additions and 3 deletions

View file

@ -27,3 +27,5 @@ Resque::Server.use Authentication
# Mailer # Mailer
Resque::Mailer.excluded_environments = [] Resque::Mailer.excluded_environments = []
Resque.before_fork = Proc.new { ActiveRecord::Base.establish_connection }

View file

@ -1,9 +1,7 @@
require 'resque/tasks' require 'resque/tasks'
task "resque:setup" => :environment do task "resque:setup" => :environment do
Resque.after_fork do Resque.before_fork = Proc.new { ActiveRecord::Base.establish_connection }
Resque.redis.client.reconnect
end
end end
desc "Alias for resque:work (To run workers on Heroku)" desc "Alias for resque:work (To run workers on Heroku)"