mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-04 03:25:14 +00:00
Simplify status batch removal SQL query (#37469)
This commit is contained in:
parent
f1c9c89c39
commit
85eda5b46f
1 changed files with 1 additions and 1 deletions
|
|
@ -31,7 +31,7 @@ class BatchedRemoveStatusService < BaseService
|
|||
# transaction lock the database, but we use the delete method instead
|
||||
# of destroy to avoid all callbacks. We rely on foreign keys to
|
||||
# cascade the delete faster without loading the associations.
|
||||
statuses_and_reblogs.each_slice(50) { |slice| Status.where(id: slice.map(&:id)).delete_all }
|
||||
statuses_and_reblogs.each_slice(50) { |slice| Status.unscoped.where(id: slice.pluck(:id)).delete_all }
|
||||
|
||||
# Since we skipped all callbacks, we also need to manually
|
||||
# deindex the statuses
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue