diff --git a/dinky-admin/src/main/java/org/dinky/job/handler/Job2MysqlHandler.java b/dinky-admin/src/main/java/org/dinky/job/handler/Job2MysqlHandler.java index 9694c50146..d7813233a0 100644 --- a/dinky-admin/src/main/java/org/dinky/job/handler/Job2MysqlHandler.java +++ b/dinky-admin/src/main/java/org/dinky/job/handler/Job2MysqlHandler.java @@ -180,8 +180,11 @@ public boolean success() { history.setClusterId(clusterId); historyService.updateById(history); - if (job.getJobConfig().isStatementSet() - && (Asserts.isNullCollection(job.getJids()) || Asserts.isNullString(job.getJobManagerAddress()))) { + if (!job.getJobConfig().isStatementSet()) { + return true; + } + + if (Asserts.isNullCollection(job.getJids()) || Asserts.isNullString(job.getJobManagerAddress())) { throw new BusException("The JobID or JobManagerAddress is null. "); } @@ -190,9 +193,7 @@ public boolean success() { jobInstance.setClusterId(clusterId); jobInstance.setTaskId(taskId); jobInstance.setName(job.getJobConfig().getJobName()); - if (Asserts.isNotNullCollection(job.getJids())) { - jobInstance.setJid(job.getJids().get(0)); - } + jobInstance.setJid(job.getJids().get(0)); jobInstance.setStep(job.getJobConfig().getStep()); jobInstance.setStatus(JobStatus.INITIALIZING.getValue()); jobInstanceService.save(jobInstance);