|
@@ -5,6 +5,7 @@ import cn.hutool.core.io.FileUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.fdkankan.common.util.CmdUtils;
|
|
|
import com.fdkankan.model.utils.CreateObjUtil;
|
|
|
import com.fdkankan.modeling.constants.RabbitMQConstant;
|
|
|
import com.fdkankan.modeling.constants.SysConstants;
|
|
@@ -65,7 +66,7 @@ public class InterruptCallingListener {
|
|
|
//如果该场景已经调起了算法进程,需要终止算法进程
|
|
|
if(SysConstants.callingNum.contains(num)){
|
|
|
//进入计算之前,把上次未关闭的算法杀掉(主要是重启的问题)
|
|
|
- CreateObjUtil.killMainLoader();
|
|
|
+ this.killMainLoader();
|
|
|
List<BuildLog> list = buildLogService.list(new LambdaQueryWrapper<BuildLog>().eq(BuildLog::getSceneNum, num).orderByDesc(BuildLog::getId));
|
|
|
if(CollUtil.isNotEmpty(list)){
|
|
|
String dataSource = list.get(0).getDataSource();
|
|
@@ -81,4 +82,11 @@ public class InterruptCallingListener {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void killMainLoader() throws Exception {
|
|
|
+ log.info("开始杀掉算法进程");
|
|
|
+ String command = "sudo ps -ef | grep 'MainLoader.exe' | grep -v grep | awk '{print $2}' | xargs kill -9";
|
|
|
+ CmdUtils.callLineSh(command);
|
|
|
+ log.info("开始杀掉算法完毕");
|
|
|
+ }
|
|
|
+
|
|
|
}
|