Commit b11c3e1f authored by Roger Rüttimann's avatar Roger Rüttimann

improve Ci::Build.with_erasable_job_artifacts scope

parent bb8c1b3d
Pipeline #54021156 failed with stages
in 68 minutes and 36 seconds
......@@ -87,13 +87,9 @@ module Ci
# TODO: remove this if Ci::JobArtifact.orphaned_with_subquery is removed
scope :with_erasable_job_artifacts, -> do
types = Ci::JobArtifact.file_types.reject do |file_type|
Ci::JobArtifact::NON_ERASABLE_FILE_TYPES.include?(file_type)
end.values
where('EXISTS (?)', ::Ci::JobArtifact.select(1)
.where('ci_builds.id = ci_job_artifacts.job_id')
.where('ci_job_artifacts.file_type IN (?)', types))
.erasable)
end
scope :with_existing_job_artifacts, ->(query) do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment