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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
1d280246
Commit
1d280246
authored
Feb 22, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ObjectStorage#changed_mounts to prevent multiple schedules for one file uploads
parent
384cb713
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
ee/app/uploaders/object_storage.rb
ee/app/uploaders/object_storage.rb
+1
-1
ee/spec/models/lfs_object_spec.rb
ee/spec/models/lfs_object_spec.rb
+15
-1
No files found.
ee/app/uploaders/object_storage.rb
View file @
1d280246
...
...
@@ -88,7 +88,7 @@ module ObjectStorage
def
changed_mounts
self
.
class
.
uploaders
.
select
do
|
mount
,
uploader_class
|
mounted_as
=
uploader_class
.
serialization_column
(
self
.
class
,
mount
)
mount
if
send
(
:"
#{
mounted_as
}
_changed?"
)
# rubocop:disable GitlabSecurity/PublicSend
mount
if
send
(
:"
#{
mounted_as
}
_changed?"
)
&&
send
(
:"
#{
mounted_as
}
"
)
&
.
exists?
# rubocop:disable GitlabSecurity/PublicSend
end
.
keys
end
...
...
ee/spec/models/lfs_object_spec.rb
View file @
1d280246
...
...
@@ -61,10 +61,24 @@ describe LfsObject do
end
it
'schedules the model for migration'
do
expect
(
ObjectStorage
::
BackgroundMoveWorker
).
to
receive
(
:perform_async
).
with
(
'LfsObjectUploader'
,
described_class
.
name
,
:file
,
kind_of
(
Numeric
))
expect
(
ObjectStorage
::
BackgroundMoveWorker
)
.
to
receive
(
:perform_async
)
.
with
(
'LfsObjectUploader'
,
described_class
.
name
,
:file
,
kind_of
(
Numeric
))
.
once
subject
end
it
'schedules the model for migration once'
do
expect
(
ObjectStorage
::
BackgroundMoveWorker
)
.
to
receive
(
:perform_async
)
.
with
(
'LfsObjectUploader'
,
described_class
.
name
,
:file
,
kind_of
(
Numeric
))
.
once
lfs_object
=
create
(
:lfs_object
)
lfs_object
.
file
=
fixture_file_upload
(
Rails
.
root
+
"spec/fixtures/dk.png"
,
"`/png"
)
lfs_object
.
save!
end
end
context
'when is unlicensed'
do
...
...
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