FIX: Don't use DistributedCache to store redis readonly state

This can cause unbound CPU usage in some cases, and excessive logging in other cases. This commit moves redis readonly information into the local process, but maintains the DistributedCache for postgres readonly state.
This commit is contained in:
David Taylor
2019-06-21 15:08:57 +01:00
committed by Guo Xiang Tan
parent f3e4e6941c
commit afb5ec811d
7 changed files with 49 additions and 20 deletions

View File

@ -139,7 +139,7 @@ class ApplicationController < ActionController::Base
end
rescue_from PG::ReadOnlySqlTransaction do |e|
Discourse.received_readonly!
Discourse.received_postgres_readonly!
Rails.logger.error("#{e.class} #{e.message}: #{e.backtrace.join("\n")}")
raise Discourse::ReadOnly
end