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
d77aaa35
Commit
d77aaa35
authored
Apr 05, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass object type to the file downloader
parent
eaf0a841
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
app/services/geo/file_download_service.rb
app/services/geo/file_download_service.rb
+2
-2
lib/gitlab/geo/file_downloader.rb
lib/gitlab/geo/file_downloader.rb
+4
-3
No files found.
app/services/geo/file_download_service.rb
View file @
d77aaa35
...
...
@@ -21,9 +21,9 @@ module Geo
def
downloader
klass
=
"Gitlab::Geo::
#{
object_type
.
to_s
.
camelize
}
Downloader"
.
constantize
klass
.
new
(
object_db_id
)
klass
.
new
(
object_
type
,
object_
db_id
)
rescue
NameError
Gitlab
::
Geo
::
FileDownloader
.
new
(
object_db_id
)
Gitlab
::
Geo
::
FileDownloader
.
new
(
object_
type
,
object_
db_id
)
end
def
try_obtain_lease
...
...
lib/gitlab/geo/file_downloader.rb
View file @
d77aaa35
module
Gitlab
module
Geo
class
FileDownloader
attr_reader
:object_db_id
attr_reader
:object_
type
,
:object_
db_id
def
initialize
(
object_db_id
)
def
initialize
(
object_type
,
object_db_id
)
@object_type
=
object_type
@object_db_id
=
object_db_id
end
...
...
@@ -15,7 +16,7 @@ module Gitlab
upload
=
Upload
.
find_by_id
(
object_db_id
)
return
unless
upload
.
present?
transfer
=
::
Gitlab
::
Geo
::
FileTransfer
.
new
(
:avatar
,
upload
)
transfer
=
::
Gitlab
::
Geo
::
FileTransfer
.
new
(
object_type
.
to_sym
,
upload
)
transfer
.
download_from_primary
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