Skip to content

Commit

Permalink
[BugFix]fix job id is null exception in query model (#3869)
Browse files Browse the repository at this point in the history
Co-authored-by: zhuxt2015 <[email protected]>
  • Loading branch information
zhuxt2015 and zhuxt2015 authored Oct 17, 2024
1 parent 846f3e0 commit ea1d900
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,19 @@ 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);
Expand Down

0 comments on commit ea1d900

Please sign in to comment.