Read about our upcoming Code of Conduct on this issue

container_expiration_policy_worker.rb 567 Bytes
Newer Older
1
2
3
4
# frozen_string_literal: true

class ContainerExpirationPolicyWorker
  include ApplicationWorker
5
  include CronjobQueue
6
7
8
9
10

  feature_category :container_registry

  def perform
    ContainerExpirationPolicy.runnable_schedules.preloaded.find_each do |container_expiration_policy|
11
12
13
14
15
      with_context(project: container_expiration_policy.project,
                   user: container_expiration_policy.project.owner) do |project:, user:|
        ContainerExpirationPolicyService.new(project, user)
          .execute(container_expiration_policy)
      end
16
17
18
    end
  end
end