Skip to content

Commit 4f5fd75

Browse files
committed
Improve connection verification
1 parent 5238032 commit 4f5fd75

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/big_rails/redis/registry.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ def build_wrapped_connection(connection)
6969
end
7070

7171
def verify_connection(connection)
72-
connection.with(&:ping) == "PONG"
72+
connection.with do |conn|
73+
connected = conn.connected?
74+
conn.ping
75+
conn.quit unless connected
76+
end
7377
end
7478

7579
def validate_name(name)

lib/big_rails/redis/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
module BigRails
44
module Redis
5-
VERSION = "0.2.0"
5+
VERSION = "0.3.0"
66
end
77
end

0 commit comments

Comments
 (0)