夜得朦胧 hace 9 meses
padre
commit
259003fccb

+ 5 - 0
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/app/service/TaskApplicationService.java

@@ -244,6 +244,11 @@ public class TaskApplicationService {
                 // 进行三次重试
                 int multiTaskRetryTimes = taskDomainService.getMultiTaskRetryTimes(taskId);
                 if (multiTaskRetryTimes < 3){
+                    try {
+                        KubernetesUtil.deletePod2(apiClient, kubernetesConfiguration.getMultiNamespace(), podName);
+                    }catch (Exception e){
+                        log.info("删除pod失败,projectId:{},taskId:{}",taskEntity.getProjectId(),taskId, e);
+                    }
                     String taskBody = taskEntity.getTaskBody();
                     SendResult<String, String> stringStringSendResult = kafkaTemplate.send(taskEntity.getProjectId(), 0,
                         taskId, taskBody).get();