lib/katello/tasks/delete_orphaned_content.rake in katello-3.4.2 vs lib/katello/tasks/delete_orphaned_content.rake in katello-3.4.4
- old
+ new
@@ -1,7 +1,14 @@
namespace :katello do
task :delete_orphaned_content => ["environment"] do
User.current = User.anonymous_admin
- Katello::Repository.delete_orphaned_content
+ SmartProxy.with_content.reverse.each do |proxy|
+ begin
+ ForemanTasks.async_task(Actions::Katello::CapsuleContent::RemoveOrphans,
+ :capsule_id => proxy.id)
+ rescue RuntimeError => e
+ Rails.logger.error "Smart proxy with ID #{proxy.id} may be down: #{e}"
+ end
+ end
puts _("Orphaned content deletion started in background.")
end
end