diff options
Diffstat (limited to 'app/workers/container_expiration_policy_worker.rb')
-rw-r--r-- | app/workers/container_expiration_policy_worker.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/workers/container_expiration_policy_worker.rb b/app/workers/container_expiration_policy_worker.rb index b15d1bf90bd..8fc139ac87c 100644 --- a/app/workers/container_expiration_policy_worker.rb +++ b/app/workers/container_expiration_policy_worker.rb @@ -15,11 +15,19 @@ class ContainerExpirationPolicyWorker # rubocop:disable Scalability/IdempotentWo def perform process_stale_ongoing_cleanups + disable_policies_without_container_repositories throttling_enabled? ? perform_throttled : perform_unthrottled end private + def disable_policies_without_container_repositories + ContainerExpirationPolicy.active.each_batch(of: BATCH_SIZE) do |policies| + policies.without_container_repositories + .update_all(enabled: false) + end + end + def process_stale_ongoing_cleanups threshold = delete_tags_service_timeout.seconds + 30.minutes ContainerRepository.with_stale_ongoing_cleanup(threshold.ago) |