From 4d8703ec056ec4cb5ab8eb9d4cf35529204f7c0b Mon Sep 17 00:00:00 2001 From: Gopal Patel Date: Wed, 21 Dec 2011 17:46:45 -0800 Subject: [PATCH] Reconnect redis client in forked thread --- lib/resque/worker.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/resque/worker.rb b/lib/resque/worker.rb index 1ee8beb5e..8e670f28b 100644 --- a/lib/resque/worker.rb +++ b/lib/resque/worker.rb @@ -194,6 +194,7 @@ def work(interval = 5.0, &block) Process.wait(@child) else procline "Processing #{job.queue} since #{Time.now.to_i}" + redis.client.reconnect # New connection for the child perform(job, &block) exit! unless @cant_fork end