]> cat aescling's git repositories - mastodon.git/commitdiff
Fix limited follower id in fan-out-on-write service (#14709)
authorTakeshi Umeda <noel.yoshiba@gmail.com>
Mon, 31 Aug 2020 16:11:27 +0000 (01:11 +0900)
committerGitHub <noreply@github.com>
Mon, 31 Aug 2020 16:11:27 +0000 (18:11 +0200)
app/services/fan_out_on_write_service.rb

index 21931c2f1edcdff634ec59068764e345221de0cd..e05d02cef4fe9ca274bf98470ca0f5da4e9baebf 100644 (file)
@@ -58,9 +58,9 @@ class FanOutOnWriteService < BaseService
   def deliver_to_mentioned_followers(status)
     Rails.logger.debug "Delivering status #{status.id} to limited followers"
 
-    status.mentions.joins(:account).merge(status.account.followers_for_local_distribution).select(:id).reorder(nil).find_in_batches do |followers|
-      FeedInsertWorker.push_bulk(followers) do |follower|
-        [status.id, follower.id, :home]
+    status.mentions.joins(:account).merge(status.account.followers_for_local_distribution).select(:id, :account_id).reorder(nil).find_in_batches do |mentions|
+      FeedInsertWorker.push_bulk(mentions) do |mention|
+        [status.id, mention.account_id, :home]
       end
     end
   end