summaryrefslogtreecommitdiff
path: root/app/services/ci/job_artifacts/destroy_batch_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/ci/job_artifacts/destroy_batch_service.rb')
-rw-r--r--app/services/ci/job_artifacts/destroy_batch_service.rb17
1 files changed, 13 insertions, 4 deletions
diff --git a/app/services/ci/job_artifacts/destroy_batch_service.rb b/app/services/ci/job_artifacts/destroy_batch_service.rb
index 90d157373c3..5121a8b0a8b 100644
--- a/app/services/ci/job_artifacts/destroy_batch_service.rb
+++ b/app/services/ci/job_artifacts/destroy_batch_service.rb
@@ -33,9 +33,11 @@ module Ci
destroy_related_records(@job_artifacts)
- Ci::DeletedObject.transaction do
- Ci::DeletedObject.bulk_import(@job_artifacts, @pick_up_at)
- Ci::JobArtifact.id_in(@job_artifacts.map(&:id)).delete_all
+ destroy_around_hook(@job_artifacts) do
+ Ci::DeletedObject.transaction do
+ Ci::DeletedObject.bulk_import(@job_artifacts, @pick_up_at)
+ Ci::JobArtifact.id_in(@job_artifacts.map(&:id)).delete_all
+ end
end
after_batch_destroy_hook(@job_artifacts)
@@ -52,6 +54,13 @@ module Ci
private
# Overriden in EE
+ # :nocov:
+ def destroy_around_hook(artifacts)
+ yield
+ end
+ # :nocov:
+
+ # Overriden in EE
def destroy_related_records(artifacts); end
# Overriden in EE
@@ -121,7 +130,7 @@ module Ci
end
def fix_expire_at?
- Feature.enabled?(:ci_detect_wrongly_expired_artifacts, default_enabled: :yaml)
+ Feature.enabled?(:ci_detect_wrongly_expired_artifacts)
end
def wrongly_expired?(artifact)