Skip to content

Commit

Permalink
Fixes #33924 - use new pulp orphans api
Browse files Browse the repository at this point in the history
adds a new setting to control cleanup time
  • Loading branch information
jlsherrill committed Nov 30, 2021
1 parent 861d765 commit fca6588
Show file tree
Hide file tree
Showing 16 changed files with 3,560 additions and 4,797 deletions.
3 changes: 2 additions & 1 deletion app/models/setting/content.rb
Expand Up @@ -154,7 +154,8 @@ def self.default_settings
self.set('bulk_load_size', N_('The number of items fetched from a single paged Pulp API call.'), 2000,
N_('Pulp bulk load size')),
self.set('upload_profiles_without_dynflow', N_('Allow Katello to update host installed packages, enabled repos, and module inventory directly instead of wrapped in Dynflow tasks (try turning off if Puma processes are using too much memory)'), true,
N_('Upload profiles without Dynflow'))
N_('Upload profiles without Dynflow')),
self.set('orphan_protection_time', N_('Time in minutes to consider orphan content as orphaned.'), 1440, N_('Orphaned Content Protection Time'))
]
end

Expand Down
4 changes: 2 additions & 2 deletions app/services/katello/pulp3/api/core.rb
Expand Up @@ -102,7 +102,7 @@ def import_api
end

def orphans_api
PulpcoreClient::OrphansApi.new(core_api_client)
PulpcoreClient::OrphansCleanupApi.new(core_api_client)
end

def artifacts_api
Expand Down Expand Up @@ -152,7 +152,7 @@ def ignore_404_exception(*)
end

def delete_orphans
[orphans_api.delete]
[orphans_api.cleanup(PulpcoreClient::OrphansCleanup.new(orphan_protection_time: Setting[:orphan_protection_time]))]
end

def delete_remote(remote_href)
Expand Down

0 comments on commit fca6588

Please sign in to comment.