From 9e795b9d901e65f054e8bc48c4808d52f72f5ca0 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 17 Dec 2018 16:39:46 +0800 Subject: [PATCH] Follow up to 704a122656e762fbd43427e3169d6dce87857d23. --- lib/discourse.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/discourse.rb b/lib/discourse.rb index 9ea8ef90ee..21a3e3341d 100644 --- a/lib/discourse.rb +++ b/lib/discourse.rb @@ -358,11 +358,8 @@ module Discourse end def self.recently_readonly? - if (read_only = last_read_only[$redis.namespace]).blank? - return false - end - - read_only > 15.seconds.ago + read_only = last_read_only[$redis.namespace] + read_only.present? && read_only > 15.seconds.ago end def self.received_readonly!