diff --git a/src/adservice-v2/src/main/java/org/daocloud/springcloud/adservice/AdserviceApplication.java b/src/adservice-v2/src/main/java/org/daocloud/springcloud/adservice/AdserviceApplication.java index ad090338ab..cc97b4c09f 100644 --- a/src/adservice-v2/src/main/java/org/daocloud/springcloud/adservice/AdserviceApplication.java +++ b/src/adservice-v2/src/main/java/org/daocloud/springcloud/adservice/AdserviceApplication.java @@ -25,7 +25,10 @@ public static void main(String[] args) { @PostConstruct public void initSentinelClusterFlow() throws Exception{ - new SentinelClusterClientInitFunc().init(); + String sentinel = System.getProperty("spring.cloud.sentinel.enabled"); + if("true".equals(sentinel)){ + new SentinelClusterClientInitFunc().init(); + } } }