Commit 7a4393f0 authored by yuanfeng's avatar yuanfeng

🚑 add zone for bili discovery in fetching server nodes

parent e784526a
......@@ -41,6 +41,7 @@ DEFINE_string(discovery_api_addr, DEFAULT_DISCOVERY_API_ADDR, "The address of di
DEFINE_int32(discovery_timeout_ms, 3000, "Timeout for discovery requests");
DEFINE_string(discovery_env, "prod", "Environment of services");
DEFINE_string(discovery_status, "1", "Status of services. 1 for ready, 2 for not ready, 3 for all");
DEFINE_string(discovery_zone, "", "Zone of services");
DEFINE_int32(discovery_renew_interval_s, 30, "The interval between two consecutive renews");
DEFINE_int32(discovery_reregister_threshold, 3, "The renew error threshold beyond"
" which Register would be called again");
......@@ -349,8 +350,9 @@ 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", service_name,
FLAGS_discovery_env.c_str(), FLAGS_discovery_status.c_str());
"/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());
chan->CallMethod(NULL, &cntl, NULL, NULL, NULL);
if (cntl.Failed()) {
LOG(ERROR) << "Fail to get /discovery/fetchs: " << cntl.ErrorText();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment