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
15548018
Commit
15548018
authored
Apr 16, 2020
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use retrieve endpoint to download blobs
parent
c4d9055d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
ee/app/models/geo_node.rb
ee/app/models/geo_node.rb
+13
-0
ee/lib/gitlab/geo/replication/blob_downloader.rb
ee/lib/gitlab/geo/replication/blob_downloader.rb
+1
-2
No files found.
ee/app/models/geo_node.rb
View file @
15548018
...
@@ -175,6 +175,19 @@ class GeoNode < ApplicationRecord
...
@@ -175,6 +175,19 @@ class GeoNode < ApplicationRecord
@internal_uri
||=
URI
.
parse
(
internal_url
)
if
internal_url
.
present?
@internal_uri
||=
URI
.
parse
(
internal_url
)
if
internal_url
.
present?
end
end
# Geo API endpoint for retrieving a replicable item
#
# @param [String] replicable_name
# @param [Integer] replicable_id
def
geo_retrieve_url
(
replicable_name
,
replicable_id
)
geo_api_url
(
"retrieve/
#{
replicable_name
}
/
#{
replicable_id
}
"
)
end
# Geo API endpoint for retrieving a file based on Uploads
#
# @deprecated
# @param [String] file_type
# @param [Integer] file_id
def
geo_transfers_url
(
file_type
,
file_id
)
def
geo_transfers_url
(
file_type
,
file_id
)
geo_api_url
(
"transfers/
#{
file_type
}
/
#{
file_id
}
"
)
geo_api_url
(
"transfers/
#{
file_type
}
/
#{
file_id
}
"
)
end
end
...
...
ee/lib/gitlab/geo/replication/blob_downloader.rb
View file @
15548018
...
@@ -49,8 +49,7 @@ module Gitlab
...
@@ -49,8 +49,7 @@ module Gitlab
# @return [String] URL to download the resource from
# @return [String] URL to download the resource from
def
resource_url
def
resource_url
# TODO change to Generalized API endpoint after that is implemented
Gitlab
::
Geo
.
primary_node
.
geo_retrieve_url
(
replicable_name
,
model_record
.
id
.
to_s
)
Gitlab
::
Geo
.
primary_node
.
geo_transfers_url
(
replicable_name
,
model_record
.
id
.
to_s
)
end
end
private
private
...
...
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