From a9d31adeb5ffeeae10f362bdcfa92e149c613783 Mon Sep 17 00:00:00 2001 From: Daria Mayorova Date: Mon, 30 Sep 2024 13:24:53 +0200 Subject: [PATCH] Destroy asynchronously --- lib/tasks/multitenant/tenants.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/multitenant/tenants.rake b/lib/tasks/multitenant/tenants.rake index 5f47ae7d83..9d2021ded7 100644 --- a/lib/tasks/multitenant/tenants.rake +++ b/lib/tasks/multitenant/tenants.rake @@ -95,7 +95,7 @@ namespace :multitenant do puts "Processing batch #{index+1} of model #{model.name}..." batch.each do |object| puts "- ID: #{object.id}, Tenant ID: #{object.tenant_id}" - object.destroy if destroy + DeletePlainObjectWorker.perform_later(object) if destroy end end orphaned_objects.find_each { |obj| }