2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-08-20 18:52:44 +08:00

FIX: Redis hostname may resolve to nothing.

This commit is contained in:
Guo Xiang Tan 2016-03-11 18:54:01 +08:00
parent 90fde5053d
commit bf209d8344
2 changed files with 26 additions and 1 deletions

View file

@ -81,7 +81,10 @@ class DiscourseRedis
client = ::Redis::Client.new(options)
client.call([:role])[0]
@options
rescue Redis::ConnectionError, Redis::CannotConnectError => ex
rescue Redis::ConnectionError, Redis::CannotConnectError, RuntimeError => ex
# A consul service name may be deregistered for a redis container setup
raise ex if ex.class == RuntimeError && ex.message != "Name or service not known"
return @slave_options if !@fallback_handler.master
@fallback_handler.master = false
raise ex