瀏覽代碼

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

Erystasius 5 年之前
父節點
當前提交
8d82dc1982
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      apollo-client/src/main/java/com/ctrip/framework/apollo/util/ConfigUtil.java

+ 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;
   }