Skip to content

Commit e5957f1

Browse files
committed
Merge branch 'fix_unconnectable_sentinel' of https://github.com/zmack/redis-rb into zmack-fix_unconnectable_sentinel
2 parents 1fc07d4 + c4cbe50 commit e5957f1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/redis/client.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,9 @@ def _parse_driver(driver)
461461
end
462462

463463
class Connector
464+
attr_reader :logger
464465
def initialize(options)
466+
@logger = options[:logger]
465467
@options = options
466468
end
467469

@@ -523,6 +525,11 @@ def sentinel_detect
523525

524526
return result
525527
end
528+
rescue CannotConnectError
529+
if logger
530+
msg = "[Redis] Could not connect to sentinel #{sentinel[:host]}:#{sentinel[:port]}"
531+
logger.debug(msg)
532+
end
526533
ensure
527534
client.disconnect
528535
end

0 commit comments

Comments
 (0)