1
0
Fork 1
forked from fedi/mastodon

FeedManager: skip account when target_account's last status is too old (#18009)

Co-authored-by: dogelover911 <dogelover911@localhost>
This commit is contained in:
dogelover911 2022-04-11 14:17:03 -05:00 committed by GitHub
parent dc50347247
commit 4c9949560d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -243,7 +243,7 @@ class FeedManager
account.following.includes(:account_stat).find_each do |target_account| account.following.includes(:account_stat).find_each do |target_account|
if redis.zcard(timeline_key) >= limit if redis.zcard(timeline_key) >= limit
oldest_home_score = redis.zrange(timeline_key, 0, 0, with_scores: true).first.last.to_i oldest_home_score = redis.zrange(timeline_key, 0, 0, with_scores: true).first.last.to_i
last_status_score = Mastodon::Snowflake.id_at(account.last_status_at) last_status_score = Mastodon::Snowflake.id_at(target_account.last_status_at)
# If the feed is full and this account has not posted more recently # If the feed is full and this account has not posted more recently
# than the last item on the feed, then we can skip the whole account # than the last item on the feed, then we can skip the whole account