Sha256: 55a4cb760cf1a0084f667ba7e68fd6678d499d1cd165bbaba64a5f51d7c89474

Contents?: true

Size: 469 Bytes

Versions: 13

Compression:

Stored size: 469 Bytes

Contents

require 'redis'
require 'redis-sentinel'

redis = Redis.new(:master_name => "example-test",
                  :sentinels => [
                    {:host => "localhost", :port => 26379},
                    {:host => "localhost", :port => 26380}
                  ],
                  :failover_reconnect_timeout => 30)
redis.set "foo", "bar"

while true
  begin
    puts redis.get "foo"
  rescue => e
    puts "failover took too long to recover", e
  end
  sleep 1
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
redic-sentinel-1.5.1 example/test_wait_for_failover.rb
redis-sentinel-1.5.0 example/test_wait_for_failover.rb
redis-sentinel-1.4.4 example/test_wait_for_failover.rb
redis-sentinel-1.4.3 example/test_wait_for_failover.rb
redis-sentinel-1.4.2 example/test_wait_for_failover.rb
redis-sentinel-1.4.1 example/test_wait_for_failover.rb
redis-sentinel-1.4.0 example/test_wait_for_failover.rb
redis-sentinel2-1.3.1 example/test_wait_for_failover.rb
redis-sentinel2-1.3.0 example/test_wait_for_failover.rb
redis-sentinel-1.3.0 example/test_wait_for_failover.rb
redis-sentinel-1.2.0 example/test_wait_for_failover.rb
redis-sentinel-1.1.4 example/test_wait_for_failover.rb
redis-sentinel-1.1.3 example/test_wait_for_failover.rb