ソースを参照

support setting apollo.cacheDir from app.properties (#2317)

Erystasius 5 年 前
コミット
8d82dc1982

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

@@ -223,6 +223,10 @@ public class ConfigUtil {
       // 3. Get from server.properties
       cacheRoot = Foundation.server().getProperty("apollo.cacheDir", null);
     }
+    if (Strings.isNullOrEmpty(cacheRoot)) {
+      // 4. Get from app.properties
+      cacheRoot = Foundation.app().getProperty("apollo.cacheDir", null);
+    }
 
     return cacheRoot;
   }