From eec47bdfaa540ae5f50b2b1bb5c175867c8121fb Mon Sep 17 00:00:00 2001 From: wangyu096 Date: Wed, 8 Feb 2023 10:45:26 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E9=80=9A=E8=BF=87esb=20api=20execute?= =?UTF-8?q?=5Fjob=20=E4=BC=A0=E5=85=A5=E7=9A=84=20bk=5Fcallback=5Furl=20?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=B8=BA=E7=A9=BA=E5=AD=97=E7=AC=A6=E6=97=B6?= =?UTF-8?q?=EF=BC=8Cjob-execute=E6=A8=A1=E5=9D=97=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E5=A4=A7=E9=87=8F=E9=94=99=E8=AF=AF=E6=97=A5=E5=BF=97=20#1726?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bk/job/execute/engine/listener/CallbackListener.java | 2 +- .../tencent/bk/job/execute/engine/listener/JobListener.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/engine/listener/CallbackListener.java b/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/engine/listener/CallbackListener.java index 9613edac78..46eb4f64ea 100644 --- a/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/engine/listener/CallbackListener.java +++ b/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/engine/listener/CallbackListener.java @@ -56,7 +56,7 @@ public void handleMessage(JobCallbackDTO callbackDTO) { try { new URL(callbackUrl); } catch (MalformedURLException var5) { - log.error("Callback fail, bad url: {}", callbackUrl); + log.warn("Callback fail, bad url: {}", callbackUrl); return; } callbackDTO.setCallbackUrl(null); diff --git a/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/engine/listener/JobListener.java b/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/engine/listener/JobListener.java index 493bf1e8aa..ef20a51c86 100644 --- a/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/engine/listener/JobListener.java +++ b/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/engine/listener/JobListener.java @@ -45,6 +45,7 @@ import com.tencent.bk.job.execute.service.TaskInstanceService; import com.tencent.bk.job.execute.statistics.StatisticsService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cloud.stream.annotation.EnableBinding; import org.springframework.cloud.stream.annotation.StreamListener; @@ -355,7 +356,7 @@ private void startStep(StepInstanceBaseDTO stepInstance) { private void callback(TaskInstanceDTO taskInstance, long jobInstanceId, int taskStatus, long currentStepId, RunStatusEnum stepStatus) { - if (taskInstance.getCallbackUrl() != null) { + if (StringUtils.isNotBlank(taskInstance.getCallbackUrl())) { JobCallbackDTO callback = new JobCallbackDTO(); callback.setId(jobInstanceId); callback.setStatus(taskStatus);