Skip to content

Commit 85ce0bb

Browse files
committed
Don't try to reconnect when the connection is fresh
This should fix #382.
1 parent 66bd1f8 commit 85ce0bb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/redis/client.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,13 @@ def initialize(options = {})
7474
def connect
7575
@pid = Process.pid
7676

77-
establish_connection
78-
call [:auth, password] if password
79-
call [:select, db] if db != 0
77+
# Don't try to reconnect when the connection is fresh
78+
with_reconnect(false) do
79+
establish_connection
80+
call [:auth, password] if password
81+
call [:select, db] if db != 0
82+
end
83+
8084
self
8185
end
8286

0 commit comments

Comments
 (0)