Kaynağa Gözat

disable Import on Combined Server to solve API Server not work issue (#1268)

Baoqi Wu 5 yıl önce
ebeveyn
işleme
9090095daf

+ 7 - 5
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/CombinedApplicationServer.java

@@ -21,17 +21,19 @@ import org.apache.dolphinscheduler.server.master.MasterServer;
 import org.apache.dolphinscheduler.server.rpc.LoggerServer;
 import org.apache.dolphinscheduler.server.worker.WorkerServer;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.web.servlet.ServletComponentScan;
 import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Import;
 import springfox.documentation.swagger2.annotations.EnableSwagger2;
 
-//@SpringBootApplication
-//@ServletComponentScan
-//@ComponentScan("org.apache.dolphinscheduler")
-//@Import({MasterServer.class, WorkerServer.class})
-//@EnableSwagger2
+@SpringBootApplication
+@ConditionalOnProperty(prefix = "server", name = "is-combined-server", havingValue = "true")
+@ServletComponentScan
+@ComponentScan("org.apache.dolphinscheduler")
+@Import({MasterServer.class, WorkerServer.class})
+@EnableSwagger2
 public class CombinedApplicationServer extends SpringBootServletInitializer {
 
     public static void main(String[] args) throws Exception {