Skip to content
Snippets Groups Projects
Unverified Commit 69f782b5 authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Fix code style of regeneration-related code (#9843)

parent 90ff2e76
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -3,6 +3,7 @@
class PrecomputeFeedService < BaseService
def call(account)
FeedManager.instance.populate_feed(account)
ensure
Redis.current.del("account:#{account.id}:regeneration")
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment