Skip to content

Commit 36da0db

Browse files
authored
Fix code style of regeneration-related code (mastodon#9843)
1 parent 9c31fe9 commit 36da0db

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

app/models/user.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ def prepare_returning_user!
362362
end
363363

364364
def regenerate_feed!
365-
Redis.current.setnx("account:#{account_id}:regeneration", true) && Redis.current.expire("account:#{account_id}:regeneration", 1.day.seconds)
365+
return unless Redis.current.setnx("account:#{account_id}:regeneration", true)
366+
Redis.current.expire("account:#{account_id}:regeneration", 1.day.seconds)
366367
RegenerationWorker.perform_async(account_id)
367368
end
368369

app/services/precompute_feed_service.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
class PrecomputeFeedService < BaseService
44
def call(account)
55
FeedManager.instance.populate_feed(account)
6+
ensure
67
Redis.current.del("account:#{account.id}:regeneration")
78
end
89
end

0 commit comments

Comments
 (0)