Skip to content

Commit

Permalink
bugfix: 通过esb api execute_job 传入的 bk_callback_url 参数为空字符时,job-execute…
Browse files Browse the repository at this point in the history
…模块出现大量错误日志 TencentBlueKing#1726
  • Loading branch information
wangyu096 committed Feb 8, 2023
1 parent abbe8cc commit eec47bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit eec47bd

Please sign in to comment.