From e14a7b0c362dd6c388101b9b1acad0a6ff5b71aa Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Mon, 2 Dec 2019 21:37:12 -0600 Subject: pruning thread leaves can cause data loss - let's not do that --- app/workers/scheduler/prune_database_scheduler.rb | 7 ------- 1 file changed, 7 deletions(-) (limited to 'app/workers') diff --git a/app/workers/scheduler/prune_database_scheduler.rb b/app/workers/scheduler/prune_database_scheduler.rb index 0e1cb6798..10a34453b 100644 --- a/app/workers/scheduler/prune_database_scheduler.rb +++ b/app/workers/scheduler/prune_database_scheduler.rb @@ -15,13 +15,6 @@ class Scheduler::PruneDatabaseScheduler BatchedRemoveStatusService.new.call(status) end - # prune leaves of threads that lost their context after a suspension - # keeping these around eats a pretty good amount of storage - deleted_mentions = Mention.where(account_id: suspended_accounts).select(:status_id) - Status.remote.where(account_id: deleted_mentions).in_batches do |status| - BatchedRemoveStatusService.new.call(status) - end - # remove mention entries that have no status or account attached to them Mention.where(account_id: nil).in_batches.destroy_all Mention.where(status_id: nil).in_batches.destroy_all -- cgit