mirror of
https://github.com/funamitech/mastodon
synced 2024-11-30 15:58:28 +09:00
Purge status reactions on account delete
This commit is contained in:
parent
d8dfb80f72
commit
f2671e7fe1
@ -149,6 +149,7 @@ class DeleteAccountService < BaseService
|
|||||||
purge_polls!
|
purge_polls!
|
||||||
purge_generated_notifications!
|
purge_generated_notifications!
|
||||||
purge_favourites!
|
purge_favourites!
|
||||||
|
purge_status_reactions!
|
||||||
purge_bookmarks!
|
purge_bookmarks!
|
||||||
purge_feeds!
|
purge_feeds!
|
||||||
purge_other_associations!
|
purge_other_associations!
|
||||||
@ -196,6 +197,15 @@ class DeleteAccountService < BaseService
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def purge_status_reactions!
|
||||||
|
@account.status_reactions.in_batches do |status_reactions|
|
||||||
|
ids = status_reactions.pluck(:status_id)
|
||||||
|
Chewy.strategy.current.update(StatusesIndex, ids) if Chewy.enabled?
|
||||||
|
Rails.cache.delete_multi(ids.map { |id| "statuses/#{id}" })
|
||||||
|
status_reactions.delete_all
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def purge_bookmarks!
|
def purge_bookmarks!
|
||||||
@account.bookmarks.in_batches do |bookmarks|
|
@account.bookmarks.in_batches do |bookmarks|
|
||||||
Chewy.strategy.current.update(StatusesIndex, bookmarks.pluck(:status_id)) if Chewy.enabled?
|
Chewy.strategy.current.update(StatusesIndex, bookmarks.pluck(:status_id)) if Chewy.enabled?
|
||||||
|
Loading…
Reference in New Issue
Block a user