davidzollo commented on code in PR #14430:
URL:
https://github.com/apache/dolphinscheduler/pull/14430#discussion_r1251554384
##########
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:
It's a very good beginning for you to start the first contribution.
You can prompt the user in a more friendly style, instead of throwing
exceptions. Here is an example:
```
log.warn("The schedule already exists.");
putMsg(result, Status.SCHEDULE_ALREADY_EXISTS);
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]