mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
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:

committed by
Guo Xiang Tan

parent
f3e4e6941c
commit
afb5ec811d
@ -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
|
||||
|
Reference in New Issue
Block a user