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