Browse Source

[FIX-14299][api]: check schedule exists (#14430)

* fix: check schedule exists

* put error message in result

---------

Co-authored-by: lutong <lutongtong211027@credithc.com>
3.2.1-prepare
lutongzero 1 year ago committed by GitHub
parent
commit
484f8419c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java

9
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java

@ -167,6 +167,15 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe
executorService.checkProcessDefinitionValid(projectCode, processDefinition, processDefineCode, executorService.checkProcessDefinitionValid(projectCode, processDefinition, processDefineCode,
processDefinition.getVersion()); processDefinition.getVersion());
Schedule scheduleExists =
scheduleMapper.queryByProcessDefinitionCode(processDefineCode);
if (scheduleExists != null) {
log.error("Schedule already exist, scheduleId:{},processDefineCode:{}", scheduleExists.getId(),
processDefineCode);
putMsg(result, Status.SCHEDULE_ALREADY_EXISTS, processDefineCode, scheduleExists.getId());
return result;
}
Schedule scheduleObj = new Schedule(); Schedule scheduleObj = new Schedule();
Date now = new Date(); Date now = new Date();

Loading…
Cancel
Save