Skip to content

Commit

Permalink
fix the problem by code quality (alibaba#6027)
Browse files Browse the repository at this point in the history
  • Loading branch information
brotherlu-xcq authored Jun 9, 2021
1 parent ce2139e commit c5ff2f7
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,17 @@ public class AddressServerMemberLookup extends AbstractMemberLookup {

private static final long DEFAULT_SYNC_TASK_DELAY_MS = 5_000L;

private static final String ADDRESS_SERVER_DOMAIN_PROPERTY = "address_server_domain";
private static final String ADDRESS_SERVER_DOMAIN_ENV = "address_server_domain";

private static final String ADDRESS_SERVER_PORT_PROPERTY = "address_server_port";
private static final String ADDRESS_SERVER_DOMAIN_PROPERTY = "address.server.domain";

private static final String ADDRESS_SERVER_URL = "address_server_url";
private static final String ADDRESS_SERVER_PORT_ENV = "address_server_port";

private static final String ADDRESS_SERVER_PORT_PROPERTY = "address.server.port";

private static final String ADDRESS_SERVER_URL_ENV = "address_server_url";

private static final String ADDRESS_SERVER_URL_PROPERTY = "address.server.url";

private static final String ADDRESS_SERVER_RETRY_PROPERTY = "nacos.core.address-server.retry";

Expand All @@ -98,21 +104,21 @@ public boolean useAddressServer() {
}

private void initAddressSys() {
String envDomainName = System.getenv(ADDRESS_SERVER_DOMAIN_PROPERTY);
String envDomainName = System.getenv(ADDRESS_SERVER_DOMAIN_ENV);
if (StringUtils.isBlank(envDomainName)) {
domainName = EnvUtil.getProperty(ADDRESS_SERVER_DOMAIN_PROPERTY, DEFAULT_SERVER_DOMAIN);
} else {
domainName = envDomainName;
}
String envAddressPort = System.getenv(ADDRESS_SERVER_PORT_PROPERTY);
String envAddressPort = System.getenv(ADDRESS_SERVER_PORT_ENV);
if (StringUtils.isBlank(envAddressPort)) {
addressPort = EnvUtil.getProperty(ADDRESS_SERVER_PORT_PROPERTY, DEFAULT_SERVER_POINT);
} else {
addressPort = envAddressPort;
}
String envAddressUrl = System.getenv(ADDRESS_SERVER_URL);
String envAddressUrl = System.getenv(ADDRESS_SERVER_URL_ENV);
if (StringUtils.isBlank(envAddressUrl)) {
addressUrl = EnvUtil.getProperty(ADDRESS_SERVER_URL, EnvUtil.getContextPath() + "/" + "serverlist");
addressUrl = EnvUtil.getProperty(ADDRESS_SERVER_URL_PROPERTY, EnvUtil.getContextPath() + "/" + "serverlist");
} else {
addressUrl = envAddressUrl;
}
Expand Down

0 comments on commit c5ff2f7

Please sign in to comment.