Skip to content

Commit

Permalink
Merge pull request #1729 from wangyu096/issue_1726_3.6.x
Browse files Browse the repository at this point in the history
[3.7.x]bugfix: 通过esb api execute_job 传入的 bk_callback_url 参数为空字符时,job-execute模块出现大量错误日志 #1726
  • Loading branch information
wangyu096 authored Feb 8, 2023
2 parents c650ccc + eec47bd commit e150c04
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 @@ -357,7 +358,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 e150c04

Please sign in to comment.