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
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
file_mover.rb
app/uploaders/file_mover.rb
+5
-1
object_storage.rb
app/uploaders/object_storage.rb
+1
-0
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
def
execute
move
uploader
.
record_upload
if
update_markdown
if
update_markdown
uploader
.
record_upload
uploader
.
schedule_background_upload
end
end
private
...
...
app/uploaders/object_storage.rb
View file @
c0047fc4
...
...
@@ -52,6 +52,7 @@ module ObjectStorage
def
schedule_background_upload
(
*
args
)
return
unless
schedule_background_upload?
return
unless
upload
ObjectStorage
::
BackgroundMoveWorker
.
perform_async
(
self
.
class
.
name
,
upload
.
class
.
to_s
,
...
...
spec/uploaders/file_mover_spec.rb
View file @
c0047fc4
...
...
@@ -36,6 +36,12 @@ describe FileMover do
it
'creates a new update record'
do
expect
{
subject
}.
to
change
{
Upload
.
count
}.
by
(
1
)
end
it
'schedules a background migration'
do
expect_any_instance_of
(
PersonalFileUploader
).
to
receive
(
:schedule_background_upload
).
once
subject
end
end
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