|
@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
|
|
+import java.util.StringJoiner;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.Executors;
|
|
import java.util.concurrent.Executors;
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
@@ -59,19 +60,25 @@ public class CetPlugController {
|
|
@Aac(auth = false)
|
|
@Aac(auth = false)
|
|
public Result test() throws IOException, InterruptedException {
|
|
public Result test() throws IOException, InterruptedException {
|
|
log.info("test is come in");
|
|
log.info("test is come in");
|
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
|
+ StringJoiner stringJoiner = new StringJoiner("");
|
|
String projectPath = System.getProperty("user.dir");
|
|
String projectPath = System.getProperty("user.dir");
|
|
int cpuNum = Runtime.getRuntime().availableProcessors();
|
|
int cpuNum = Runtime.getRuntime().availableProcessors();
|
|
ExecutorService executor = Executors.newFixedThreadPool(Math.abs(cpuNum / 2));
|
|
ExecutorService executor = Executors.newFixedThreadPool(Math.abs(cpuNum / 2));
|
|
if (Objects.nonNull(cet4Dir)) {
|
|
if (Objects.nonNull(cet4Dir)) {
|
|
logicService.execFile(cet4Dir, projectPath, "cet4", executor);
|
|
logicService.execFile(cet4Dir, projectPath, "cet4", executor);
|
|
}
|
|
}
|
|
|
|
+ if (Objects.nonNull(cet6Dir)) {
|
|
|
|
+ logicService.execFile(cet6Dir, projectPath, "cet6", executor);
|
|
|
|
+ }
|
|
executor.shutdown();
|
|
executor.shutdown();
|
|
while (!executor.awaitTermination(1, TimeUnit.MINUTES)) {
|
|
while (!executor.awaitTermination(1, TimeUnit.MINUTES)) {
|
|
log.info("线程池没有关闭");
|
|
log.info("线程池没有关闭");
|
|
}
|
|
}
|
|
log.info("线程池已经关闭");
|
|
log.info("线程池已经关闭");
|
|
|
|
+ long end = System.currentTimeMillis();
|
|
|
|
+ stringJoiner.add("============耗时============:").add((end - start) / 1000 + "").add("秒");
|
|
|
|
+ log.info("request:{}", stringJoiner.toString());
|
|
return ResultUtil.ok();
|
|
return ResultUtil.ok();
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|