about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-01-18 01:02:51 +0100
committerGitHub <noreply@github.com>2019-01-18 01:02:51 +0100
commit69f782b54d035789a6386ed979940dd9719af1a1 (patch)
tree353783facf96b95090f0d76cb9ef09528430daf5 /app/models
parent90ff2e7608321389e968f512e709a1e0a7bf2657 (diff)
Fix code style of regeneration-related code (#9843)
Diffstat (limited to 'app/models')
-rw-r--r--app/models/user.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 8b374c182..5aa5c2b15 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -362,7 +362,8 @@ class User < ApplicationRecord
   end
 
   def regenerate_feed!
-    Redis.current.setnx("account:#{account_id}:regeneration", true) && Redis.current.expire("account:#{account_id}:regeneration", 1.day.seconds)
+    return unless Redis.current.setnx("account:#{account_id}:regeneration", true)
+    Redis.current.expire("account:#{account_id}:regeneration", 1.day.seconds)
     RegenerationWorker.perform_async(account_id)
   end