Improve counter caches on Status and Account (#7644)
Do not touch statuses_count on accounts table when mass-destroying statuses to reduce load when removing accounts, same for reblogs_count and favourites_count Do not count statuses with direct visibility in statuses_count Fix #828
This commit is contained in:
parent
461542784b
commit
a7d726c383
6 changed files with 126 additions and 7 deletions
|
@ -21,7 +21,10 @@ class BatchedRemoveStatusService < BaseService
|
|||
@activity_xml = {}
|
||||
|
||||
# Ensure that rendered XML reflects destroyed state
|
||||
statuses.each(&:destroy)
|
||||
statuses.each do |status|
|
||||
status.mark_for_mass_destruction!
|
||||
status.destroy
|
||||
end
|
||||
|
||||
# Batch by source account
|
||||
statuses.group_by(&:account_id).each_value do |account_statuses|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue