Module: Packages::CleanupArtifactWorker
Instance Method Summary
collapse
#max_running_jobs, #perform, #remove_failed_jobs, #report_prometheus_metrics
Instance Method Details
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'app/workers/concerns/packages/cleanup_artifact_worker.rb', line 9
def perform_work
return unless artifact
begin
artifact.transaction do
log_metadata(artifact)
artifact.destroy!
end
rescue StandardError => exception
unless artifact&.destroyed?
artifact&.update_column(:status, :error)
end
Gitlab::ErrorTracking.log_exception(
exception,
class: self.class.name
)
end
after_destroy
end
|
#remaining_work_count ⇒ Object
32
33
34
|
# File 'app/workers/concerns/packages/cleanup_artifact_worker.rb', line 32
def remaining_work_count
artifacts_pending_destruction.limit(max_running_jobs + 1).count
end
|