PERF: Reduce hit to Redis server when keeping a site in reaonly mode.

This commit is contained in:
Guo Xiang Tan 2019-02-19 10:29:08 +08:00
parent 86a2172bda
commit c29076152d
1 changed files with 1 additions and 3 deletions

View File

@ -333,9 +333,7 @@ module Discourse
@dbs.each do |db| @dbs.each do |db|
RailsMultisite::ConnectionManagement.with_connection(db) do RailsMultisite::ConnectionManagement.with_connection(db) do
if readonly_mode?(key) if !$redis.expire(key, READONLY_MODE_KEY_TTL)
$redis.expire(key, READONLY_MODE_KEY_TTL)
else
@dbs.delete(db) @dbs.delete(db)
end end
end end