debian-mirror-gitlab/app/services/container_expiration_policy_service.rb

18 lines
541 B
Ruby
Raw Normal View History

2020-03-09 13:42:32 +05:30
# frozen_string_literal: true
class ContainerExpirationPolicyService < BaseService
def execute(container_expiration_policy)
container_expiration_policy.schedule_next_run!
container_expiration_policy.container_repositories.find_each do |container_repository|
CleanupContainerRepositoryWorker.perform_async(
nil,
container_repository.id,
container_expiration_policy.attributes
.except('created_at', 'updated_at')
.merge(container_expiration_policy: true)
)
end
end
end