Merge remote-tracking branch 'parent/main' into kbtopic-remove-quote
This commit is contained in:
commit
c538c23ef7
141 changed files with 1552 additions and 779 deletions
|
@ -9,4 +9,12 @@ class HomeFeed < Feed
|
|||
def regenerating?
|
||||
redis.exists?("account:#{@account.id}:regeneration")
|
||||
end
|
||||
|
||||
def regeneration_in_progress!
|
||||
redis.set("account:#{@account.id}:regeneration", true, nx: true, ex: 1.day.seconds)
|
||||
end
|
||||
|
||||
def regeneration_finished!
|
||||
redis.del("account:#{@account.id}:regeneration")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -555,7 +555,11 @@ class User < ApplicationRecord
|
|||
end
|
||||
|
||||
def regenerate_feed!
|
||||
RegenerationWorker.perform_async(account_id) if redis.set("account:#{account_id}:regeneration", true, nx: true, ex: 1.day.seconds)
|
||||
home_feed = HomeFeed.new(account)
|
||||
unless home_feed.regenerating?
|
||||
home_feed.regeneration_in_progress!
|
||||
RegenerationWorker.perform_async(account_id)
|
||||
end
|
||||
end
|
||||
|
||||
def needs_feed_update?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue