Commit 64db738f9de3839090eef6a862581a0e72f6540d
1 parent
c5eba169
Exists in
master
and in
4 other branches
Trying to fix resque issue
Showing
2 changed files
with
3 additions
and
3 deletions
Show diff stats
config/initializers/4_resque.rb
| @@ -27,3 +27,5 @@ Resque::Server.use Authentication | @@ -27,3 +27,5 @@ Resque::Server.use Authentication | ||
| 27 | 27 | ||
| 28 | # Mailer | 28 | # Mailer |
| 29 | Resque::Mailer.excluded_environments = [] | 29 | Resque::Mailer.excluded_environments = [] |
| 30 | + | ||
| 31 | +Resque.before_fork = Proc.new { ActiveRecord::Base.establish_connection } |
lib/tasks/resque.rake
| 1 | require 'resque/tasks' | 1 | require 'resque/tasks' |
| 2 | 2 | ||
| 3 | task "resque:setup" => :environment do | 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 | end | 5 | end |
| 8 | 6 | ||
| 9 | desc "Alias for resque:work (To run workers on Heroku)" | 7 | desc "Alias for resque:work (To run workers on Heroku)" |