BigW Consortium Gitlab

expire_build_artifacts_worker.rb 341 Bytes
Newer Older
1
class ExpireBuildArtifactsWorker
2 3 4 5 6
  include Sidekiq::Worker

  def perform
    Rails.logger.info 'Cleaning old build artifacts'

7
    builds = Ci::Build.with_expired_artifacts
8
    builds.find_each(batch_size: 50).each do |build|
9
      Rails.logger.debug "Removing artifacts build #{build.id}..."
10 11 12 13
      build.erase_artifacts!
    end
  end
end