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
|
@ -41,9 +41,10 @@ class SuspendAccountService < BaseService
|
|||
end
|
||||
|
||||
def purge_profile!
|
||||
@account.suspended = true
|
||||
@account.display_name = ''
|
||||
@account.note = ''
|
||||
@account.suspended = true
|
||||
@account.display_name = ''
|
||||
@account.note = ''
|
||||
@account.statuses_count = 0
|
||||
@account.avatar.destroy
|
||||
@account.header.destroy
|
||||
@account.save!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue