Skip to content

Commit bfc221c

Browse files
badboydjanowski
authored andcommitted
Show error in basic Sentinel example
1 parent 4ca0fa3 commit bfc221c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/sentinel.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Sentinels = [{:host => "127.0.0.1", :port => 26379},
44
{:host => "127.0.0.1", :port => 26380}]
5-
r = Redis.new(:url => "sentinel://mymaster", :sentinels => Sentinels, :role => :master)
5+
r = Redis.new(:url => "redis://master1", :sentinels => Sentinels, :role => :master)
66

77
# Set keys into a loop.
88
#
@@ -12,8 +12,8 @@
1212
begin
1313
r.set(i,i)
1414
puts i
15-
rescue
16-
puts "ERROR #{i}"
15+
rescue => e
16+
puts "(#{i}) ERR: #{e}"
1717
end
1818
sleep(0.01)
1919
}

0 commit comments

Comments
 (0)