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
c0047fc4
Commit
c0047fc4
authored
Mar 16, 2018
by
Micaël Bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
personal snippets will now comply with `background_upload`
parent
2dbd31c1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
app/uploaders/file_mover.rb
app/uploaders/file_mover.rb
+5
-1
app/uploaders/object_storage.rb
app/uploaders/object_storage.rb
+1
-0
spec/uploaders/file_mover_spec.rb
spec/uploaders/file_mover_spec.rb
+6
-0
No files found.
app/uploaders/file_mover.rb
View file @
c0047fc4
...
@@ -10,7 +10,11 @@ class FileMover
...
@@ -10,7 +10,11 @@ class FileMover
def
execute
def
execute
move
move
uploader
.
record_upload
if
update_markdown
if
update_markdown
uploader
.
record_upload
uploader
.
schedule_background_upload
end
end
end
private
private
...
...
app/uploaders/object_storage.rb
View file @
c0047fc4
...
@@ -52,6 +52,7 @@ module ObjectStorage
...
@@ -52,6 +52,7 @@ module ObjectStorage
def
schedule_background_upload
(
*
args
)
def
schedule_background_upload
(
*
args
)
return
unless
schedule_background_upload?
return
unless
schedule_background_upload?
return
unless
upload
ObjectStorage
::
BackgroundMoveWorker
.
perform_async
(
self
.
class
.
name
,
ObjectStorage
::
BackgroundMoveWorker
.
perform_async
(
self
.
class
.
name
,
upload
.
class
.
to_s
,
upload
.
class
.
to_s
,
...
...
spec/uploaders/file_mover_spec.rb
View file @
c0047fc4
...
@@ -36,6 +36,12 @@ describe FileMover do
...
@@ -36,6 +36,12 @@ describe FileMover do
it
'creates a new update record'
do
it
'creates a new update record'
do
expect
{
subject
}.
to
change
{
Upload
.
count
}.
by
(
1
)
expect
{
subject
}.
to
change
{
Upload
.
count
}.
by
(
1
)
end
end
it
'schedules a background migration'
do
expect_any_instance_of
(
PersonalFileUploader
).
to
receive
(
:schedule_background_upload
).
once
subject
end
end
end
context
'when update_markdown fails'
do
context
'when update_markdown fails'
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