Permalink
Browse files

Merge pull request #1528 from fimmtiu/reconnect-after-writing-pidfile

Reconnect to Redis after writing the pidfile.
  • Loading branch information...
2 parents 20d8850 + baf9bac commit 835a4a7e61a2e33832dbf11975ecfab54af293c6 @fw42 fw42 committed on GitHub Dec 13, 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 835a4a7

Please sign in to comment.