Skip to content

Commit

Permalink
fix: 保存模版,作业超时时间用户未设置,不会自动设置为 7200 TencentBlueKing#2765
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyu096 committed Feb 2, 2024
1 parent e1e13c1 commit c85fadb
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
import java.util.List;
import java.util.Set;

/**
* @since 15/10/2019 20:27
*/
@Slf4j
@Data
@EqualsAndHashCode(callSuper = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.tencent.bk.job.common.constant.DuplicateHandlerEnum;
import com.tencent.bk.job.common.constant.ErrorCode;
import com.tencent.bk.job.common.constant.JobConstants;
import com.tencent.bk.job.common.constant.NotExistPathHandlerEnum;
import com.tencent.bk.job.common.exception.InvalidParamException;
import com.tencent.bk.job.common.util.FilePathValidateUtil;
Expand All @@ -38,9 +39,6 @@

import java.util.List;

/**
* @since 16/10/2019 14:46
*/
@Data
@ApiModel("步骤文件信息")
@Slf4j
Expand Down Expand Up @@ -127,7 +125,7 @@ public void validate(boolean isCreate) throws InvalidParamException {
throw new InvalidParamException(ErrorCode.ILLEGAL_PARAM);
}
if (timeout == null || timeout < 0) {
timeout = 0L;
timeout = (long) JobConstants.DEFAULT_JOB_TIMEOUT_SECONDS;
}
if (originSpeedLimit == null || originSpeedLimit <= 0) {
originSpeedLimit = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.constraints.Range;

/**
* @since 16/10/2019 14:46
*/
@Data
@ApiModel("任务脚本步骤信息")
@Slf4j
Expand Down Expand Up @@ -120,9 +117,6 @@ public void validate(boolean isCreate) throws InvalidParamException {
if (StringUtils.isNotBlank(scriptParam) && scriptParam.length() > 5000) {
scriptParam = scriptParam.substring(0, 5000);
}
if (timeout == null) {
timeout = 3600L;
}
if (ignoreError == null || ignoreError < 0) {
ignoreError = 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
import javax.validation.Valid;
import java.util.List;

/**
* @since 16/10/2019 10:37
*/
@Data
@ApiModel("任务步骤信息")
@Slf4j
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@

import com.tencent.bk.job.common.constant.DuplicateHandlerEnum;
import com.tencent.bk.job.common.constant.ErrorCode;
import com.tencent.bk.job.common.constant.JobConstants;
import com.tencent.bk.job.common.constant.NotExistPathHandlerEnum;
import com.tencent.bk.job.common.esb.model.job.v3.EsbAccountV3BasicDTO;
import com.tencent.bk.job.common.esb.model.job.v3.EsbFileDestinationV3DTO;
import com.tencent.bk.job.common.esb.model.job.v3.resp.EsbFileStepV3DTO;
import com.tencent.bk.job.common.exception.InvalidParamException;
import com.tencent.bk.job.execute.common.constants.FileTransferModeEnum;
import com.tencent.bk.job.common.esb.model.job.v3.resp.EsbFileStepV3DTO;
import com.tencent.bk.job.manage.model.inner.ServiceAccountDTO;
import com.tencent.bk.job.manage.model.inner.ServiceTaskFileStepDTO;
import com.tencent.bk.job.manage.model.web.vo.task.TaskFileDestinationInfoVO;
Expand Down Expand Up @@ -116,7 +117,8 @@ public static TaskFileStepDTO fromVO(Long stepId, TaskFileStepVO fileStepVO) {
fileStep.setExecuteAccount(fileStepVO.getFileDestination().getAccount());
fileStep.setDestinationHostList(TaskTargetDTO.fromVO(fileStepVO.getFileDestination().getServer()));
}
fileStep.setTimeout(fileStepVO.getTimeout());
fileStep.setTimeout(fileStepVO.getTimeout() == null ?
(long) JobConstants.DEFAULT_JOB_TIMEOUT_SECONDS : fileStepVO.getTimeout());
fileStep.setOriginSpeedLimit(fileStepVO.getOriginSpeedLimit());
fileStep.setTargetSpeedLimit(fileStepVO.getTargetSpeedLimit());
if (fileStepVO.getTransferMode() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@

package com.tencent.bk.job.manage.model.dto.task;

import com.tencent.bk.job.common.constant.JobConstants;
import com.tencent.bk.job.common.esb.model.job.v3.EsbAccountV3BasicDTO;
import com.tencent.bk.job.common.esb.model.job.v3.resp.EsbScriptStepV3DTO;
import com.tencent.bk.job.common.util.Base64Util;
import com.tencent.bk.job.manage.common.consts.script.ScriptTypeEnum;
import com.tencent.bk.job.manage.common.consts.task.TaskScriptSourceEnum;
import com.tencent.bk.job.common.esb.model.job.v3.resp.EsbScriptStepV3DTO;
import com.tencent.bk.job.manage.model.inner.ServiceAccountDTO;
import com.tencent.bk.job.manage.model.inner.ServiceTaskScriptStepDTO;
import com.tencent.bk.job.manage.model.web.vo.task.TaskScriptStepVO;
Expand Down Expand Up @@ -125,7 +126,7 @@ public static TaskScriptStepDTO fromVO(Long stepId, TaskScriptStepVO scriptStepV
scriptStep.setLanguage(ScriptTypeEnum.valueOf(scriptStepVO.getScriptLanguage()));
scriptStep.setScriptParam(scriptStepVO.getScriptParam());
if (scriptStepVO.getTimeout() == null) {
scriptStep.setTimeout(60L);
scriptStep.setTimeout((long) JobConstants.DEFAULT_JOB_TIMEOUT_SECONDS);
} else {
scriptStep.setTimeout(scriptStepVO.getTimeout());
}
Expand Down

0 comments on commit c85fadb

Please sign in to comment.