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

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

class ExpireBuildInstanceArtifactsWorker
  include ApplicationWorker

  def perform(build_id)
    build = Ci::Build
      .with_expired_artifacts
      .reorder(nil)
      .find_by(id: build_id)

    return unless build&.project && !build.project.pending_delete

    Rails.logger.info "Removing artifacts for build #{build.id}..."
    build.erase_artifacts!
  end
end