Skip to content

Commit c92e403

Browse files
authored
Merge pull request #1219 from casperisfine/sentinel-reconnection
Fix `Redis#without_reconnect` for sentinel clients
2 parents 5d5252d + 3ea6b57 commit c92e403

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Unreleased
22

3+
- Fix `Redis#without_reconnect` for sentinel clients. Fix #1212.
4+
35
# 5.0.7
46

57
- Fix compatibility with `redis-client 0.15.0` when using Redis Sentinel. Fix #1209.

lib/redis/client.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,6 @@ def multi
117117
Client.translate_error!(error)
118118
end
119119

120-
def disable_reconnection(&block)
121-
ensure_connected(retryable: false, &block)
122-
end
123-
124120
def inherit_socket!
125121
@inherit_socket = true
126122
end

redis.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ Gem::Specification.new do |s|
4545

4646
s.required_ruby_version = '>= 2.5.0'
4747

48-
s.add_runtime_dependency('redis-client', '>= 0.9.0')
48+
s.add_runtime_dependency('redis-client', '>= 0.16.0')
4949
end

test/sentinel/sentinel_test.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ def test_sentinel_slave_role_connection
2323
assert_equal MASTER_PORT.to_i, actual[2]
2424
end
2525

26+
def test_without_reconnect
27+
wait_for_quorum
28+
29+
redis.without_reconnect do
30+
redis.get("key")
31+
end
32+
end
33+
2634
def test_the_client_can_connect_to_available_slaves
2735
commands = {
2836
sentinel: lambda do |*_|

0 commit comments

Comments
 (0)