Переглянути джерело

Merge remote-tracking branch 'origin/master'

allen 1 рік тому
батько
коміт
3c7cb93d71

+ 8 - 1
pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/impl/RunPythonImpl.java

@@ -6,6 +6,7 @@ import com.pdaaphm.biz.domain.SubAlgorithm;
 import com.pdaaphm.biz.dto.RequestDTO;
 import com.pdaaphm.biz.mapper.FileMapper;
 import com.pdaaphm.biz.mapper.SubAlgorithmMapper;
+import com.pdaaphm.biz.service.IRedisLogService;
 import com.pdaaphm.biz.service.RunAlgorithmService;
 import com.pdaaphm.common.config.PadaphmConfig;
 import com.pdaaphm.common.utils.DateUtils;
@@ -38,6 +39,9 @@ public class RunPythonImpl implements RunAlgorithmService {
     @Autowired
     private SubAlgorithmMapper subAlgorithmMapper;
 
+    @Autowired
+    private IRedisLogService redisLogService;
+
     private final Logger logger = LoggerFactory.getLogger(this.getClass());
 
     @Override
@@ -49,6 +53,7 @@ public class RunPythonImpl implements RunAlgorithmService {
         httpRequestFactory.setConnectTimeout(3000);
         httpRequestFactory.setReadTimeout(3000);
         WebClient webClient = WebClient.create(url);
+        redisLogService.info("TASK-"+ id, "分析算法程序......");
         // send post
         Mono<BaseResponse> result = webClient.post()  // 使用POST方法
                 .uri("/request")  // 指定URI
@@ -68,7 +73,8 @@ public class RunPythonImpl implements RunAlgorithmService {
                 });  // 将响应体转换为String
         // get response
         BaseResponse res = result.block();
-
+        redisLogService.info("TASK-"+ id, "分析算法文件完成......");
+        redisLogService.info("TASK-"+ id, "执行算法......");
         // save result path to subAlgorithm
         List<String> resultList = requestDto.getResultList();
         List<Map> subAlgorithmOutputList = subAlgorithmMapper.selectSubAlgorithmOutputList(id);
@@ -102,6 +108,7 @@ public class RunPythonImpl implements RunAlgorithmService {
                 subAlgorithm.setUploadId(resultFile.getId());
                 subAlgorithm.setCreateTime(DateUtils.getNowDate());
                 subAlgorithmMapper.updateSubAlgorithm(subAlgorithm);
+                redisLogService.info("TASK-"+ id, "执行算法完成......");
             }
             else {
                 logger.error("输出文件未生成!");