1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2025-03-05 13:19:20 +01:00

Fix pushing hashtag-followed posts to feeds of inactive users ()

This commit is contained in:
Eugen Rochko 2024-11-22 09:30:57 +01:00 committed by Claire
parent 1ffb8ef747
commit e26bb6f827
2 changed files with 3 additions and 1 deletions

View file

@ -21,4 +21,6 @@ class TagFollow < ApplicationRecord
accepts_nested_attributes_for :tag
rate_limit by: :account, family: :follows
scope :for_local_distribution, -> { joins(account: :user).merge(User.signed_in_recently) }
end

View file

@ -94,7 +94,7 @@ class FanOutOnWriteService < BaseService
end
def deliver_to_hashtag_followers!
TagFollow.where(tag_id: @status.tags.map(&:id)).select(:id, :account_id).reorder(nil).find_in_batches do |follows|
TagFollow.for_local_distribution.where(tag_id: @status.tags.map(&:id)).select(:id, :account_id).reorder(nil).find_in_batches do |follows|
FeedInsertWorker.push_bulk(follows) do |follow|
[@status.id, follow.account_id, 'tags', { 'update' => update? }]
end