You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "rickchengx (via GitHub)" <gi...@apache.org> on 2023/07/04 02:43:02 UTC
[GitHub] [dolphinscheduler] rickchengx commented on a diff in pull request #14430: [FIX-14299][api]: check schedule exists
rickchengx commented on code in PR #14430:
URL: https://github.com/apache/dolphinscheduler/pull/14430#discussion_r1251413646
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java:
##########
@@ -167,6 +167,13 @@ public Map<String, Object> insertSchedule(User loginUser,
executorService.checkProcessDefinitionValid(projectCode, processDefinition, processDefineCode,
processDefinition.getVersion());
+ Schedule scheduleExists =
+ scheduleMapper.queryByProcessDefinitionCode(processDefineCode);
+ if (scheduleExists != null) {
+ throw new ServiceException(Status.SCHEDULE_ALREADY_EXISTS, processDefineCode,
Review Comment:
Could we put a message in the result to tell the reason to the user, like below:
```
if (scheduleExists != null) {
log.error("xxx");
putMsg(result, Status.XXX);
return result;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org