mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
modern terminology
This commit is contained in:
parent
1daa32dd9c
commit
d3fc2958d3
2 changed files with 4 additions and 4 deletions
|
@ -96,8 +96,8 @@ module Sidekiq
|
||||||
begin
|
begin
|
||||||
yield conn
|
yield conn
|
||||||
rescue Redis::CommandError => ex
|
rescue Redis::CommandError => ex
|
||||||
#2550 Failover can cause the server to become a slave, need
|
#2550 Failover can cause the server to become a replica, need
|
||||||
# to disconnect and reopen the socket to get back to the master.
|
# to disconnect and reopen the socket to get back to the primary.
|
||||||
(conn.disconnect!; retryable = false; retry) if retryable && ex.message =~ /READONLY/
|
(conn.disconnect!; retryable = false; retry) if retryable && ex.message =~ /READONLY/
|
||||||
raise
|
raise
|
||||||
end
|
end
|
||||||
|
|
|
@ -82,7 +82,7 @@ class TestSidekiq < Minitest::Test
|
||||||
it 'does not continually retry' do
|
it 'does not continually retry' do
|
||||||
assert_raises Redis::CommandError do
|
assert_raises Redis::CommandError do
|
||||||
Sidekiq.redis do |c|
|
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
|
end
|
||||||
end
|
end
|
||||||
|
@ -91,7 +91,7 @@ class TestSidekiq < Minitest::Test
|
||||||
counts = []
|
counts = []
|
||||||
Sidekiq.redis do |c|
|
Sidekiq.redis do |c|
|
||||||
counts << c.info['total_connections_received'].to_i
|
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
|
end
|
||||||
assert_equal 2, counts.size
|
assert_equal 2, counts.size
|
||||||
assert_equal counts[0] + 1, counts[1]
|
assert_equal counts[0] + 1, counts[1]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue