Browse Source

Merge pull request #1291 from nobodyiam/sysenv-name-fix

system variable cannot contain dot
Jason Song 6 years ago
parent
commit
41a32fee9c

+ 1 - 1
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/ConfigServiceLocator.java

@@ -75,7 +75,7 @@ public class ConfigServiceLocator {
     String configServices = System.getProperty("apollo.configService");
     if (Strings.isNullOrEmpty(configServices)) {
       // 2. Get from OS environment variable
-      configServices = System.getenv("APOLLO.CONFIGSERVICE");
+      configServices = System.getenv("APOLLO_CONFIGSERVICE");
     }
     if (Strings.isNullOrEmpty(configServices)) {
       // 3. Get from server.properties

+ 1 - 1
apollo-client/src/main/java/com/ctrip/framework/apollo/util/ConfigUtil.java

@@ -222,7 +222,7 @@ public class ConfigUtil {
     String cacheRoot = System.getProperty("apollo.cacheDir");
     if (Strings.isNullOrEmpty(cacheRoot)) {
       // 2. Get from OS environment variable
-      cacheRoot = System.getenv("APOLLO.CACHEDIR");
+      cacheRoot = System.getenv("APOLLO_CACHEDIR");
     }
     if (Strings.isNullOrEmpty(cacheRoot)) {
       // 3. Get from server.properties

+ 1 - 1
apollo-core/src/main/java/com/ctrip/framework/apollo/core/MetaDomainConsts.java

@@ -85,7 +85,7 @@ public class MetaDomainConsts {
     String metaAddress = System.getProperty("apollo.meta");
     if (Strings.isNullOrEmpty(metaAddress)) {
       // 2. Get from OS environment variable
-      metaAddress = System.getenv("APOLLO.META");
+      metaAddress = System.getenv("APOLLO_META");
     }
     if (Strings.isNullOrEmpty(metaAddress)) {
       metaAddress = Foundation.server().getProperty("apollo.meta", null);