martin 3 tahun lalu
induk
melakukan
5fd0fd6c0e

File diff ditekan karena terlalu besar
+ 289 - 0
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/consumer/ManualProjectConsumer.java


+ 4 - 0
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/mapper/TaskMapper.java

@@ -115,4 +115,8 @@ public interface TaskMapper {
             "where id = #{taskId}")
     void updateStateById(@Param("runState") String runState, @Param("taskId") String taskId);
 
+    @Select("select p_id\n" +
+            "from simulation_manual_project_task\n" +
+            "where id = #{taskId}")
+    String selectProjectIdById(@Param("taskId")String taskId);
 }

+ 3 - 2
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/scheduler/TickScheduler.java

@@ -45,7 +45,8 @@ public class TickScheduler {
         if (executingTaskList != null && executingTaskList.size() > 0) {
             //        log.info("------- TickScheduler 查询出所有执行中的任务('Running'):" + executingTaskList);
             //2 根据 key 查出任务的心跳时间
-            executingTaskList.forEach(task -> {
+
+            for (TaskPO task : executingTaskList) {
                 String taskId = task.getId();
                 String projectId = task.getPId();
                 try {
@@ -67,7 +68,7 @@ public class TickScheduler {
                 } catch (Exception e) {
                     throw new RuntimeException(e.getMessage());
                 }
-            });
+            }
         }
 
     }

+ 4 - 0
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/service/TaskService.java

@@ -116,6 +116,10 @@ public class TaskService {
 //            taskManager.updateFailStateWithStopTime(taskId, state, TimeUtil.getNowForMysql());
             taskMapper.updateFailStateWithStopTime(taskId, state, TimeUtil.getNowForMysql());
             redisTemplate.delete("podName:" + taskId);
+            //result-path-minio: /project/manual-project/
+            String projectId = taskMapper.selectProjectIdById(taskId);
+            String minioPathOfErrorLog = resultPathMinio + projectId + "/" + taskId + "error.log";
+
             return;
         } else if ("PendingAnalysis".equals(state)) {
             LinuxUtil.execute("kubectl delete pod " + podName);

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini