DEV: Avoid logging errors on bad Redis connection during PG failover.

This commit is contained in:
Guo Xiang Tan 2020-06-29 11:54:55 +08:00
parent 89bac20b8e
commit 2c4c953bf8
No known key found for this signature in database
GPG Key ID: FBD110179AAC1F20

View File

@ -55,7 +55,10 @@ if defined?(RailsFailover::ActiveRecord)
Discourse::PG_FORCE_READONLY_MODE_KEY
)
rescue => e
Rails.logger.warn "#{e.class} #{e.message}: #{e.backtrace.join("\n")}"
unless e.is_a?(Redis::CannotConnectError)
Rails.logger.warn "#{e.class} #{e.message}: #{e.backtrace.join("\n")}"
end
false
end
end