Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/ci/job_artifacts/destroy_batch_service.rb b/app/services/ci/job_artifacts/destroy_batch_service.rb
index d5a0a2dd885..90d157373c3 100644
--- a/app/services/ci/job_artifacts/destroy_batch_service.rb
+++ b/app/services/ci/job_artifacts/destroy_batch_service.rb
@@ -117,7 +117,7 @@ module Ci
wrongly_expired_artifacts, @job_artifacts = @job_artifacts.partition { |artifact| wrongly_expired?(artifact) }
- remove_expire_at(wrongly_expired_artifacts)
+ remove_expire_at(wrongly_expired_artifacts) if wrongly_expired_artifacts.any?
end
def fix_expire_at?
@@ -127,7 +127,9 @@ module Ci
def wrongly_expired?(artifact)
return false unless artifact.expire_at.present?
- match_date?(artifact.expire_at) && match_time?(artifact.expire_at)
+ # Although traces should never have expiration dates that don't match time & date here.
+ # we can explicitly exclude them by type since they should never be destroyed.
+ artifact.trace? || (match_date?(artifact.expire_at) && match_time?(artifact.expire_at))
end
def match_date?(expire_at)