Commit 64db738f9de3839090eef6a862581a0e72f6540d

Authored by Dmitriy Zaporozhets
1 parent c5eba169

Trying to fix resque issue

config/initializers/4_resque.rb
... ... @@ -27,3 +27,5 @@ Resque::Server.use Authentication
27 27  
28 28 # Mailer
29 29 Resque::Mailer.excluded_environments = []
  30 +
  31 +Resque.before_fork = Proc.new { ActiveRecord::Base.establish_connection }
... ...
lib/tasks/resque.rake
1 1 require 'resque/tasks'
2 2  
3 3 task "resque:setup" => :environment do
4   - Resque.after_fork do
5   - Resque.redis.client.reconnect
6   - end
  4 + Resque.before_fork = Proc.new { ActiveRecord::Base.establish_connection }
7 5 end
8 6  
9 7 desc "Alias for resque:work (To run workers on Heroku)"
... ...