diff --git a/app/jobs/remove_outdated_items_job.rb b/app/jobs/remove_outdated_items_job.rb index 5c470de35..a799ceaa5 100644 --- a/app/jobs/remove_outdated_items_job.rb +++ b/app/jobs/remove_outdated_items_job.rb @@ -15,7 +15,9 @@ class RemoveOutdatedItemsJob < BaseActiveRecordJob counter_pbl = ProductBuildList.outdated.count ProductBuildList.outdated.destroy_all User.find_each(batch_size: 50) do |u| - u.activity_feeds.outdated.destroy_all + u.activity_feeds.outdated.find_each(batch_size: 100) do |a| + a.destroy + end end File.open(log_file, "w") do |f| f.puts "Build Lists deleted: #{counter_bl}"