Commit 4dddd585 authored by Shinya Maeda's avatar Shinya Maeda

Import use_file method from EE and use it for calculation of checksum

parent c2954f38
......@@ -71,6 +71,14 @@ class GitlabUploader < CarrierWave::Uploader::Base
!!model
end
##
# ObjectStorage::Concern extends this method for remote files
def use_file
if file_storage?
return yield path
end
end
private
# Designed to be overridden by child uploaders that have a dynamic path
......
......@@ -28,7 +28,9 @@ class JobArtifactUploader < GitlabUploader
private
def calc_checksum
Digest::SHA256.file(file.path).hexdigest
use_file do |file_path|
return Digest::SHA256.file(file_path).hexdigest
end
end
def dynamic_segment
......
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