From 1367c8255fb4836b0f6aa8cae3e0f5166ea0ffcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AF=B8=E8=91=9B=E5=AD=90=E6=88=BF?= Date: Wed, 18 Oct 2023 23:19:24 +0800 Subject: [PATCH] [Fix] Fix view job log error (#248) (#249) --- .../src/main/java/io/datavines/core/enums/Status.java | 2 ++ .../repository/service/impl/JobExecutionServiceImpl.java | 3 +++ 2 files changed, 5 insertions(+) diff --git a/datavines-core/src/main/java/io/datavines/core/enums/Status.java b/datavines-core/src/main/java/io/datavines/core/enums/Status.java index 8a7175718..df90e3316 100644 --- a/datavines-core/src/main/java/io/datavines/core/enums/Status.java +++ b/datavines-core/src/main/java/io/datavines/core/enums/Status.java @@ -68,6 +68,8 @@ public enum Status { TASK_LOG_PATH_NOT_EXIST_ERROR(13010002, "Task {0} Log Path Not Exist Error", "任务 {0} 的日志路径不存在错误"), TASK_EXECUTE_HOST_NOT_EXIST_ERROR(13010003, "Task Execute Host {0} Not Exist Error", "任务 {0} 的执行服务地址不存在错误"), + TASK_EXECUTE_NOT_RUNNING(13010004, "Taskt {0} has not running", "任务 {0} 还没有开始运行,请稍后重试"), + JOB_PARAMETER_IS_NULL_ERROR(14010001, "Job {0} Parameter is Null Error", "作业 {0} 参数为空错误"), CREATE_JOB_ERROR(14010002, "Create Job {0} Error", "创建作业 {0} 错误"), JOB_NOT_EXIST_ERROR(14010003, "Job {0} Not Exist Error", "作业 {0} 不存在错误"), diff --git a/datavines-server/src/main/java/io/datavines/server/repository/service/impl/JobExecutionServiceImpl.java b/datavines-server/src/main/java/io/datavines/server/repository/service/impl/JobExecutionServiceImpl.java index 47aa2af51..0fecb75c1 100644 --- a/datavines-server/src/main/java/io/datavines/server/repository/service/impl/JobExecutionServiceImpl.java +++ b/datavines-server/src/main/java/io/datavines/server/repository/service/impl/JobExecutionServiceImpl.java @@ -264,6 +264,9 @@ public String getJobExecutionHost(Long jobExecutionId) { if(null == jobExecution){ throw new DataVinesServerException(Status.TASK_NOT_EXIST_ERROR, jobExecutionId); } + if(jobExecution.getStatus() == ExecutionStatus.SUBMITTED_SUCCESS){ + throw new DataVinesServerException(Status.TASK_EXECUTE_NOT_RUNNING, jobExecutionId); + } String executeHost = jobExecution.getExecuteHost(); if(StringUtils.isEmpty(executeHost)){ throw new DataVinesServerException(Status.TASK_EXECUTE_HOST_NOT_EXIST_ERROR, jobExecutionId);