Skip to content

Commit 06773bf

Browse files
committed
treat DEV and LPT as a cluster
1 parent 6dfefd8 commit 06773bf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ private void initCluster() {
6565
//Load data center from system property
6666
cluster = System.getProperty(ConfigConsts.APOLLO_CLUSTER_KEY);
6767

68+
String env = Foundation.server().getEnvType();
69+
//LPT and DEV will be treated as a cluster(lower case)
70+
if (Strings.isNullOrEmpty(cluster) &&
71+
(Env.DEV.name().equalsIgnoreCase(env) || Env.LPT.name().equalsIgnoreCase(env))
72+
) {
73+
cluster = env.toLowerCase();
74+
}
75+
6876
//Use TOOLING cluster if tooling=true in server.properties
6977
if (Strings.isNullOrEmpty(cluster) && isToolingZone()) {
7078
cluster = TOOLING_CLUSTER;

0 commit comments

Comments
 (0)