From 64db738f9de3839090eef6a862581a0e72f6540d Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 25 Dec 2012 15:53:50 +0200 Subject: [PATCH] Trying to fix resque issue --- config/initializers/4_resque.rb | 2 ++ lib/tasks/resque.rake | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/initializers/4_resque.rb b/config/initializers/4_resque.rb index 419dbe06..03c2b785 100644 --- a/config/initializers/4_resque.rb +++ b/config/initializers/4_resque.rb @@ -27,3 +27,5 @@ Resque::Server.use Authentication # Mailer Resque::Mailer.excluded_environments = [] + +Resque.before_fork = Proc.new { ActiveRecord::Base.establish_connection } diff --git a/lib/tasks/resque.rake b/lib/tasks/resque.rake index 0825324a..36e461da 100644 --- a/lib/tasks/resque.rake +++ b/lib/tasks/resque.rake @@ -1,9 +1,7 @@ require 'resque/tasks' task "resque:setup" => :environment do - Resque.after_fork do - Resque.redis.client.reconnect - end + Resque.before_fork = Proc.new { ActiveRecord::Base.establish_connection } end desc "Alias for resque:work (To run workers on Heroku)"