Trying to fix sidekiq memory leak
This commit is contained in:
parent
54e4622ce1
commit
73a3c2270f
|
@ -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}"
|
||||
|
|
Loading…
Reference in New Issue