BigW Consortium Gitlab

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

  def perform
6
    Rails.logger.info 'Scheduling removal of build artifacts'
7

8 9 10 11
    build_ids = Ci::Build.with_expired_artifacts.pluck(:id)
    build_ids = build_ids.map { |build_id| [build_id] }

    Sidekiq::Client.push_bulk('class' => ExpireBuildInstanceArtifactsWorker, 'args' => build_ids )
12 13
  end
end