diff options
Diffstat (limited to 'app/models/ci/job_artifact.rb')
-rw-r--r-- | app/models/ci/job_artifact.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/models/ci/job_artifact.rb b/app/models/ci/job_artifact.rb index d5e88f2be5b..50e21a1c323 100644 --- a/app/models/ci/job_artifact.rb +++ b/app/models/ci/job_artifact.rb @@ -131,8 +131,6 @@ module Ci update_project_statistics project_statistics_name: :build_artifacts_size scope :not_expired, -> { where('expire_at IS NULL OR expire_at > ?', Time.current) } - scope :with_files_stored_locally, -> { where(file_store: ::JobArtifactUploader::Store::LOCAL) } - scope :with_files_stored_remotely, -> { where(file_store: ::JobArtifactUploader::Store::REMOTE) } scope :for_sha, ->(sha, project_id) { joins(job: :pipeline).where(ci_pipelines: { sha: sha, project_id: project_id }) } scope :for_job_name, ->(name) { joins(:job).where(ci_builds: { name: name }) } @@ -292,8 +290,12 @@ module Ci end end + def archived_trace_exists? + file&.file&.exists? + end + def self.archived_trace_exists_for?(job_id) - where(job_id: job_id).trace.take&.file&.file&.exists? + where(job_id: job_id).trace.take&.archived_trace_exists? end def self.max_artifact_size(type:, project:) |