blob: 0d4c9e12cb98bf19199f1a778a430b74ca2ba16e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# frozen_string_literal: true
module ObjectStorage
class DeleteStaleDirectUploadsWorker
include ApplicationWorker
data_consistency :sticky
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
# TODO: Determine proper feature category for this, as object storage is a shared feature.
# For now, only build artifacts use this worker.
feature_category :build_artifacts
idempotent!
deduplicate :until_executed
def perform
result = ObjectStorage::DeleteStaleDirectUploadsService.new.execute
log_extra_metadata_on_done(:total_pending_entries, result[:total_pending_entries])
log_extra_metadata_on_done(:total_deleted_stale_entries, result[:total_deleted_stale_entries])
log_extra_metadata_on_done(:execution_timeout, result[:execution_timeout])
end
end
end
|