Permalink
Browse files

Reconnect to Redis after writing the pidfile.

  • Loading branch information...
1 parent 20d8850 commit baf9bac80143d9d1f34470288269b362807b8716 @fimmtiu fimmtiu committed Dec 12, 2016
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/resque/worker.rb
@@ -160,12 +160,13 @@ def prepare
abort "env var BACKGROUND is set, which requires ruby >= 1.9"
end
Process.daemon(true)
- self.reconnect
end
if ENV['PIDFILE']
File.open(ENV['PIDFILE'], 'w') { |f| f << pid }
end
+
+ self.reconnect if ENV['BACKGROUND']
end
def queues=(queues)

0 comments on commit baf9bac

Please sign in to comment.