mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:26:54 -06:00
PERF: Reduce hit to Redis server when keeping a site in reaonly mode.
This commit is contained in:
parent
86a2172bda
commit
c29076152d
@ -333,9 +333,7 @@ module Discourse
|
||||
|
||||
@dbs.each do |db|
|
||||
RailsMultisite::ConnectionManagement.with_connection(db) do
|
||||
if readonly_mode?(key)
|
||||
$redis.expire(key, READONLY_MODE_KEY_TTL)
|
||||
else
|
||||
if !$redis.expire(key, READONLY_MODE_KEY_TTL)
|
||||
@dbs.delete(db)
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user