mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 00:47:46 -06:00
DEV: Don't blow up request redis can't be reached during failover.
This commit is contained in:
parent
531eca985e
commit
cbb4ea1ea8
@ -65,9 +65,14 @@ if ENV["ACTIVE_RECORD_RAILS_FAILOVER"]
|
||||
end
|
||||
|
||||
RailsFailover::ActiveRecord.register_force_reading_role_callback do
|
||||
Discourse.redis.exists(
|
||||
Discourse::PG_READONLY_MODE_KEY,
|
||||
Discourse::PG_FORCE_READONLY_MODE_KEY
|
||||
)
|
||||
begin
|
||||
Discourse.redis.exists?(
|
||||
Discourse::PG_READONLY_MODE_KEY,
|
||||
Discourse::PG_FORCE_READONLY_MODE_KEY
|
||||
)
|
||||
rescue => e
|
||||
Discourse.warn_exception(e)
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user