2018-06-27 07:23:28 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-02-19 18:09:10 +00:00
|
|
|
class ExpireBuildArtifactsWorker # rubocop:disable Scalability/IdempotentWorker
|
2017-11-28 16:08:30 +00:00
|
|
|
include ApplicationWorker
|
2021-04-30 18:10:09 +00:00
|
|
|
|
2021-07-21 12:09:35 +00:00
|
|
|
data_consistency :always
|
|
|
|
|
2020-02-10 12:08:59 +00:00
|
|
|
# rubocop:disable Scalability/CronWorkerContext
|
|
|
|
# This worker does not perform work scoped to a context
|
|
|
|
include CronjobQueue
|
|
|
|
# rubocop:enable Scalability/CronWorkerContext
|
2016-05-18 20:21:51 +00:00
|
|
|
|
2019-10-18 11:11:44 +00:00
|
|
|
feature_category :continuous_integration
|
|
|
|
|
2016-05-18 20:21:51 +00:00
|
|
|
def perform
|
2021-03-16 09:11:17 +00:00
|
|
|
service = Ci::JobArtifacts::DestroyAllExpiredService.new
|
2021-01-14 15:10:46 +00:00
|
|
|
artifacts_count = service.execute
|
|
|
|
log_extra_metadata_on_done(:destroyed_job_artifacts_count, artifacts_count)
|
2019-01-17 06:06:37 +00:00
|
|
|
end
|
2016-05-18 20:21:51 +00:00
|
|
|
end
|