Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
c05d3317
Commit
c05d3317
authored
Dec 04, 2019
by
yuanfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✏
if setting disovery zone, fetching nodes api url will append zone info
parent
7a4393f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
discovery_naming_service.cpp
src/brpc/policy/discovery_naming_service.cpp
+8
-4
No files found.
src/brpc/policy/discovery_naming_service.cpp
View file @
c05d3317
...
...
@@ -349,10 +349,14 @@ int DiscoveryNamingService::GetServers(const char* service_name,
}
servers
->
clear
();
Controller
cntl
;
cntl
.
http_request
().
uri
()
=
butil
::
string_printf
(
"/discovery/fetchs?appid=%s&env=%s&status=%s&zone=%s"
,
service_name
,
FLAGS_discovery_env
.
c_str
(),
FLAGS_discovery_status
.
c_str
(),
FLAGS_discovery_zone
.
c_str
());
std
::
string
uri_str
=
butil
::
string_printf
(
"/discovery/fetchs?appid=%s&env=%s&status=%s"
,
service_name
,
FLAGS_discovery_env
.
c_str
(),
FLAGS_discovery_status
.
c_str
());
if
(
!
FLAGS_discovery_zone
.
empty
())
{
uri_str
.
append
(
"&zone="
,
6
);
uri_str
.
append
(
FLAGS_discovery_zone
);
}
cntl
.
http_request
().
uri
()
=
uri_str
;
chan
->
CallMethod
(
NULL
,
&
cntl
,
NULL
,
NULL
,
NULL
);
if
(
cntl
.
Failed
())
{
LOG
(
ERROR
)
<<
"Fail to get /discovery/fetchs: "
<<
cntl
.
ErrorText
();
...
...
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