fix multicache redis disconnections on job fork
Change-Id: Icfde84927a8a1a9da1b419227b78ee882d3ed347 Reviewed-on: https://gerrit.instructure.com/205291 Reviewed-by: Cody Cutrer <cody@instructure.com> QA-Review: Cody Cutrer <cody@instructure.com> Product-Review: Cody Cutrer <cody@instructure.com> Tested-by: Jenkins
This commit is contained in:
parent
d64e5366b1
commit
38b9fc59a1
|
@ -69,6 +69,17 @@ module Canvas
|
|||
end
|
||||
end
|
||||
|
||||
if MultiCache.cache.is_a?(ActiveSupport::Cache::HaStore)
|
||||
Canvas::Redis.handle_redis_failure(nil, "none") do
|
||||
redis = MultiCache.cache.redis
|
||||
if redis.respond_to?(:nodes)
|
||||
redis.nodes.each(&:disconnect!)
|
||||
else
|
||||
redis.disconnect!
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return unless @redis
|
||||
# We're sharing redis connections between Canvas.redis and Rails.cache,
|
||||
# so don't call reconnect on the cache too.
|
||||
|
|
Loading…
Reference in New Issue