Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
4dddd585
Commit
4dddd585
authored
Feb 28, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import use_file method from EE and use it for calculation of checksum
parent
c2954f38
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
app/uploaders/gitlab_uploader.rb
app/uploaders/gitlab_uploader.rb
+8
-0
app/uploaders/job_artifact_uploader.rb
app/uploaders/job_artifact_uploader.rb
+3
-1
No files found.
app/uploaders/gitlab_uploader.rb
View file @
4dddd585
...
...
@@ -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
...
...
app/uploaders/job_artifact_uploader.rb
View file @
4dddd585
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment