Skip to content

Commit

Permalink
Fix pushing hashtag-followed posts to feeds of inactive users (mastod…
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron authored Nov 22, 2024
1 parent 0518613 commit d75088d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/models/tag_follow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion app/services/fan_out_on_write_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def deliver_to_all_followers!
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
Expand Down

0 comments on commit d75088d

Please sign in to comment.