Skip to content

Commit

Permalink
Improve connection verification
Browse files Browse the repository at this point in the history
  • Loading branch information
ngan committed Mar 19, 2022
1 parent 5238032 commit 4f5fd75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/big_rails/redis/registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ def build_wrapped_connection(connection)
end

def verify_connection(connection)
connection.with(&:ping) == "PONG"
connection.with do |conn|
connected = conn.connected?
conn.ping
conn.quit unless connected
end
end

def validate_name(name)
Expand Down
2 changes: 1 addition & 1 deletion lib/big_rails/redis/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module BigRails
module Redis
VERSION = "0.2.0"
VERSION = "0.3.0"
end
end

0 comments on commit 4f5fd75

Please sign in to comment.