Class: ContainerExpirationPolicyWorker

Inherits:
Object
  • Object
show all
Includes:
ApplicationWorker, CronjobQueue, ExclusiveLeaseGuard
Defined in:
app/workers/container_expiration_policy_worker.rb

Overview

rubocop:disable Scalability/IdempotentWorker

Constant Summary collapse

InvalidPolicyError =
Class.new(StandardError)
BATCH_SIZE =
1000

Constants included from ApplicationWorker

ApplicationWorker::LOGGING_EXTRA_KEY, ApplicationWorker::SAFE_PUSH_BULK_LIMIT

Constants included from WorkerAttributes

WorkerAttributes::DEFAULT_DATA_CONSISTENCY, WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_DATA_CONSISTENCIES, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES

Instance Method Summary collapse

Methods included from ExclusiveLeaseGuard

#exclusive_lease, #lease_key, #lease_release?, #log_error, #release_lease, #renew_lease!, #try_obtain_lease

Methods included from Gitlab::SidekiqVersioning::Worker

#job_version

Methods included from WorkerContext

#with_context

Instance Method Details

#performObject


21
22
23
24
25
26
27
28
# File 'app/workers/container_expiration_policy_worker.rb', line 21

def perform
  process_stale_ongoing_cleanups
  disable_policies_without_container_repositories
  try_obtain_lease do
    ContainerExpirationPolicies::CleanupContainerRepositoryWorker.perform_with_capacity
  end
  log_counts
end