From 6804228fdfab70b25eab300d0ce16d4321f947a8 Mon Sep 17 00:00:00 2001
From: Claire <claire.github-309c@sitedethib.com>
Date: Tue, 1 Nov 2022 16:03:51 +0100
Subject: [PATCH] Fix N+1 on mentions in PushUpdateWorker (#19637)

---
 app/workers/push_update_worker.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/workers/push_update_worker.rb b/app/workers/push_update_worker.rb
index ae444cfde9..9f44c32b3b 100644
--- a/app/workers/push_update_worker.rb
+++ b/app/workers/push_update_worker.rb
@@ -6,7 +6,7 @@ class PushUpdateWorker
 
   def perform(account_id, status_id, timeline_id = nil, options = {})
     @account     = Account.find(account_id)
-    @status      = Status.find(status_id)
+    @status      = Status.includes(active_mentions: :account, reblog: { active_mentions: :account }).find(status_id)
     @timeline_id = timeline_id || "timeline:#{account.id}"
     @options     = options.symbolize_keys
 
-- 
GitLab