1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

modern terminology

This commit is contained in:
Mike Perham 2019-01-07 16:30:27 -08:00
parent 1daa32dd9c
commit d3fc2958d3
2 changed files with 4 additions and 4 deletions

View file

@ -96,8 +96,8 @@ module Sidekiq
begin
yield conn
rescue Redis::CommandError => ex
#2550 Failover can cause the server to become a slave, need
# to disconnect and reopen the socket to get back to the master.
#2550 Failover can cause the server to become a replica, need
# to disconnect and reopen the socket to get back to the primary.
(conn.disconnect!; retryable = false; retry) if retryable && ex.message =~ /READONLY/
raise
end

View file

@ -82,7 +82,7 @@ class TestSidekiq < Minitest::Test
it 'does not continually retry' do
assert_raises Redis::CommandError do
Sidekiq.redis do |c|
raise Redis::CommandError, "READONLY You can't write against a read only slave."
raise Redis::CommandError, "READONLY You can't write against a replica."
end
end
end
@ -91,7 +91,7 @@ class TestSidekiq < Minitest::Test
counts = []
Sidekiq.redis do |c|
counts << c.info['total_connections_received'].to_i
raise Redis::CommandError, "READONLY You can't write against a read only slave." if counts.size == 1
raise Redis::CommandError, "READONLY You can't write against a replica." if counts.size == 1
end
assert_equal 2, counts.size
assert_equal counts[0] + 1, counts[1]