2016-06-10 11:27:49 -04:00
|
|
|
class ExpireBuildArtifactsWorker
|
2017-11-28 11:08:30 -05:00
|
|
|
include ApplicationWorker
|
2016-10-21 12:13:41 -04:00
|
|
|
include CronjobQueue
|
2016-05-18 16:21:51 -04:00
|
|
|
|
|
|
|
def perform
|
2016-10-07 05:11:02 -04:00
|
|
|
Rails.logger.info 'Scheduling removal of build artifacts'
|
2016-05-18 16:21:51 -04:00
|
|
|
|
2016-10-07 05:11:02 -04:00
|
|
|
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 )
|
2016-05-18 16:21:51 -04:00
|
|
|
end
|
|
|
|
end
|