Permalink
Browse files

#735: add sleep before retry

  • Loading branch information...
avokhmin committed Dec 6, 2012
1 parent 29a8431 commit 2d24ae5b3a177202cc54562b07e89f5fecb78a98
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/redis/client.rb
View
@@ -288,7 +288,8 @@ def ensure_connected
rescue ConnectionError, TimeoutError
disconnect
- if tries < 2 && @reconnect
+ if tries < 4 && @reconnect
+ sleep(tries + 1)
retry
else
raise

0 comments on commit 2d24ae5

Please sign in to comment.