소스 검색

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