From aab04fe780e5a9a490c26e403de06a208703b0b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=A6=E9=80=9A?= <594754793@qq.com> Date: Sun, 13 Oct 2024 17:44:33 +0800 Subject: [PATCH 1/2] fix job id is null exception in query model --- .../main/java/org/dinky/job/handler/Job2MysqlHandler.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 a52f906d43..f237c7564e 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,17 +180,18 @@ public boolean success() { history.setClusterId(clusterId); historyService.updateById(history); - if (Asserts.isNullCollection(job.getJids()) || Asserts.isNullString(job.getJobManagerAddress())) { + if (job.getJobConfig().isStatementSet() && (Asserts.isNullCollection(job.getJids()) || Asserts.isNullString(job.getJobManagerAddress()))) { throw new BusException("The JobID or JobManagerAddress is null. "); } - String jid = job.getJids().get(0); JobInstance jobInstance = history.buildJobInstance(); jobInstance.setHistoryId(job.getId()); jobInstance.setClusterId(clusterId); jobInstance.setTaskId(taskId); jobInstance.setName(job.getJobConfig().getJobName()); - jobInstance.setJid(jid); + if (Asserts.isNotNullCollection(job.getJids())) { + jobInstance.setJid(job.getJids().get(0)); + } jobInstance.setStep(job.getJobConfig().getStep()); jobInstance.setStatus(JobStatus.INITIALIZING.getValue()); jobInstanceService.save(jobInstance); From d1e900fe7e28914cd8591620d3a9824e540b9348 Mon Sep 17 00:00:00 2001 From: zhuxt2015 Date: Sun, 13 Oct 2024 09:53:46 +0000 Subject: [PATCH 2/2] Spotless Apply --- .../src/main/java/org/dinky/job/handler/Job2MysqlHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 f237c7564e..9694c50146 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,7 +180,8 @@ 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() + && (Asserts.isNullCollection(job.getJids()) || Asserts.isNullString(job.getJobManagerAddress()))) { throw new BusException("The JobID or JobManagerAddress is null. "); }