Welcome to mirror list, hosted at ThFree Co, Russian Federation.

expire_artifacts_worker.rb « pipeline_artifacts « ci « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fff979d95a9ec9e82c1b385b6a76f73e15425b0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

module Ci
  module PipelineArtifacts
    class ExpireArtifactsWorker
      include ApplicationWorker
      # rubocop:disable Scalability/CronWorkerContext
      # This worker does not perform work scoped to a context
      include CronjobQueue
      # rubocop:enable Scalability/CronWorkerContext

      deduplicate :until_executed, including_scheduled: true
      idempotent!
      feature_category :continuous_integration

      def perform
        service = ::Ci::PipelineArtifacts::DestroyAllExpiredService.new
        artifacts_count = service.execute
        log_extra_metadata_on_done(:destroyed_pipeline_artifacts_count, artifacts_count)
      end
    end
  end
end