Use #any? instead of #exists? when checking media attachments (#7570)
If media_attachments are not loaded, SQL query is the same, but the #exists? method performs SQL query even if preloaded
This commit is contained in:
parent
e583f110c3
commit
32d4372381
3 changed files with 3 additions and 3 deletions
|
@ -81,7 +81,7 @@ class BatchedRemoveStatusService < BaseService
|
|||
redis.publish('timeline:public', payload)
|
||||
redis.publish('timeline:public:local', payload) if status.local?
|
||||
|
||||
if status.media_attachments.exists?
|
||||
if status.media_attachments.any?
|
||||
redis.publish('timeline:public:media', payload)
|
||||
redis.publish('timeline:public:local:media', payload) if status.local?
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue