BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
263717d7
Commit
263717d7
authored
Sep 19, 2017
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not perform hard check (presence of file on storage)
Instead perform soft check (the column set to indicate that file does exist)
parent
7e69f188
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
3 deletions
+8
-3
uploads_controller.rb
app/controllers/projects/uploads_controller.rb
+1
-1
avatar_uploader.rb
app/uploaders/avatar_uploader.rb
+1
-1
gitlab_uploader.rb
app/uploaders/gitlab_uploader.rb
+1
-1
do-not-perform-disk-check.yml
changelogs/unreleased/do-not-perform-disk-check.yml
+5
-0
No files found.
app/controllers/projects/uploads_controller.rb
View file @
263717d7
...
@@ -28,7 +28,7 @@ class Projects::UploadsController < Projects::ApplicationController
...
@@ -28,7 +28,7 @@ class Projects::UploadsController < Projects::ApplicationController
end
end
def
image_or_video?
def
image_or_video?
uploader
&&
uploader
.
file
.
exists?
&&
uploader
.
image_or_video?
uploader
&&
uploader
.
exists?
&&
uploader
.
image_or_video?
end
end
def
uploader_class
def
uploader_class
...
...
app/uploaders/avatar_uploader.rb
View file @
263717d7
...
@@ -9,7 +9,7 @@ class AvatarUploader < GitlabUploader
...
@@ -9,7 +9,7 @@ class AvatarUploader < GitlabUploader
end
end
def
exists?
def
exists?
model
.
avatar
.
file
&&
model
.
avatar
.
file
.
exists
?
model
.
avatar
.
file
&&
model
.
avatar
.
file
.
present
?
end
end
# We set move_to_store and move_to_cache to 'false' to prevent stealing
# We set move_to_store and move_to_cache to 'false' to prevent stealing
...
...
app/uploaders/gitlab_uploader.rb
View file @
263717d7
...
@@ -51,7 +51,7 @@ class GitlabUploader < CarrierWave::Uploader::Base
...
@@ -51,7 +51,7 @@ class GitlabUploader < CarrierWave::Uploader::Base
end
end
def
exists?
def
exists?
file
.
try
(
:exists?
)
file
.
present?
end
end
# Override this if you don't want to save files by default to the Rails.root directory
# Override this if you don't want to save files by default to the Rails.root directory
...
...
changelogs/unreleased/do-not-perform-disk-check.yml
0 → 100644
View file @
263717d7
---
title
:
File uploaders do not perform hard check, only soft check
merge_request
:
author
:
type
:
fixed
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