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
Boxiang Sun
gitlab-ce
Commits
8fe5bcde
Commit
8fe5bcde
authored
Mar 30, 2018
by
Micaël Bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apply feedback
parent
f3de4809
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
app/workers/object_storage/migrate_uploads_worker.rb
app/workers/object_storage/migrate_uploads_worker.rb
+15
-1
No files found.
app/workers/object_storage/migrate_uploads_worker.rb
View file @
8fe5bcde
...
@@ -159,7 +159,11 @@ module ObjectStorage
...
@@ -159,7 +159,11 @@ module ObjectStorage
raise
(
SanityCheckError
,
"Mount point
#{
mounted_as
}
not found in
#{
model_class
}
."
)
unless
model_has_mount
raise
(
SanityCheckError
,
"Mount point
#{
mounted_as
}
not found in
#{
model_class
}
."
)
unless
model_has_mount
end
end
def
perform
(
ids
,
model_type
,
mounted_as
,
to_store
)
def
perform
(
*
args
)
args_check!
(
args
)
(
ids
,
model_type
,
mounted_as
,
to_store
)
=
args
@model_class
=
model_type
.
constantize
@model_class
=
model_type
.
constantize
@mounted_as
=
mounted_as
&
.
to_sym
@mounted_as
=
mounted_as
&
.
to_sym
@to_store
=
to_store
@to_store
=
to_store
...
@@ -179,6 +183,16 @@ module ObjectStorage
...
@@ -179,6 +183,16 @@ module ObjectStorage
self
.
class
.
sanity_check!
(
uploads
,
@model_class
,
@mounted_as
)
self
.
class
.
sanity_check!
(
uploads
,
@model_class
,
@mounted_as
)
end
end
def
args_check!
(
args
)
return
if
args
.
count
==
4
case
args
.
count
when
3
then
raise
SanityCheckError
,
"Job is missing the `model_type` argument."
else
raise
SanityCheckError
,
"Job has wrong arguments format."
end
end
def
build_uploaders
(
uploads
)
def
build_uploaders
(
uploads
)
uploads
.
map
{
|
upload
|
upload
.
build_uploader
(
@mounted_as
)
}
uploads
.
map
{
|
upload
|
upload
.
build_uploader
(
@mounted_as
)
}
end
end
...
...
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