From 704a122656e762fbd43427e3169d6dce87857d23 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 17 Dec 2018 13:08:12 +0800 Subject: [PATCH] Remove Ruby warning due to assignment in conditional. --- lib/discourse.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/discourse.rb b/lib/discourse.rb index cab68f014fa..c78402b5638 100644 --- a/lib/discourse.rb +++ b/lib/discourse.rb @@ -358,7 +358,10 @@ module Discourse end def self.recently_readonly? - return false unless read_only = last_read_only[$redis.namespace] + if (read_only = last_read_only[$redis.namespace]).blank? + return false + end + read_only > 15.seconds.ago end