Commit 002f314f authored by Shinya Maeda's avatar Shinya Maeda

Expose current_path

parent b9692501
...@@ -14,9 +14,11 @@ class JobArtifactUploader < GitlabUploader ...@@ -14,9 +14,11 @@ class JobArtifactUploader < GitlabUploader
end end
def open def open
raise 'Only File System is supported' unless file_storage? if file_storage?
File.open(path, "rb")
File.open(path) if path else
raise 'Only File System is supported'
end
end end
private private
......
...@@ -101,6 +101,12 @@ module Gitlab ...@@ -101,6 +101,12 @@ module Gitlab
job.erase_old_trace! job.erase_old_trace!
end end
def current_path
@current_path ||= paths.find do |trace_path|
File.exist?(trace_path)
end
end
private private
def ensure_path def ensure_path
...@@ -116,12 +122,6 @@ module Gitlab ...@@ -116,12 +122,6 @@ module Gitlab
end end
end end
def current_path
@current_path ||= paths.find do |trace_path|
File.exist?(trace_path)
end
end
## ##
# This method doesn't include the latest path, which is JobArtifactUploader#default_path, # This method doesn't include the latest path, which is JobArtifactUploader#default_path,
# Because, in EE, traces can be moved to ObjectStorage, so checking paths in Filestorage doesn't make sense. # Because, in EE, traces can be moved to ObjectStorage, so checking paths in Filestorage doesn't make sense.
......
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