zhongjiajie commented on a change in pull request #6668:
URL: https://github.com/apache/dolphinscheduler/pull/6668#discussion_r740979033



##########
File path: 
dolphinscheduler-python/src/main/java/org/apache/dolphinscheduler/server/PythonGatewayServer.java
##########
@@ -177,7 +177,7 @@ public Long createOrUpdateProcessDefinition(String userName,
         long projectCode = project.getCode();
         Map<String, Object> verifyProcessDefinitionExists = 
processDefinitionService.verifyProcessDefinitionName(user, projectCode, name);
 
-        if (verifyProcessDefinitionExists.get(Constants.STATUS) != 
Status.SUCCESS) {
+        if (verifyProcessDefinitionExists.get(Constants.STATUS) == 
Status.PROCESS_DEFINITION_NAME_EXIST) {

Review comment:
       Hi wenjun, we would create project with assigned user before code 
running to this line. So I think we nearly zero percent to miss this situation. 
Until other process drop project or user object after I create it just now.

##########
File path: 
dolphinscheduler-python/src/main/java/org/apache/dolphinscheduler/server/PythonGatewayServer.java
##########
@@ -177,7 +177,7 @@ public Long createOrUpdateProcessDefinition(String userName,
         long projectCode = project.getCode();
         Map<String, Object> verifyProcessDefinitionExists = 
processDefinitionService.verifyProcessDefinitionName(user, projectCode, name);
 
-        if (verifyProcessDefinitionExists.get(Constants.STATUS) != 
Status.SUCCESS) {
+        if (verifyProcessDefinitionExists.get(Constants.STATUS) == 
Status.PROCESS_DEFINITION_NAME_EXIST) {

Review comment:
       Hi wenjun, we would create project with assigned user before code 
running to this line. So I think we nearly zero percent to miss this situation. 
Unless other process drop project or user object after I create it just now.

##########
File path: 
dolphinscheduler-python/src/main/java/org/apache/dolphinscheduler/server/PythonGatewayServer.java
##########
@@ -177,7 +177,7 @@ public Long createOrUpdateProcessDefinition(String userName,
         long projectCode = project.getCode();
         Map<String, Object> verifyProcessDefinitionExists = 
processDefinitionService.verifyProcessDefinitionName(user, projectCode, name);
 
-        if (verifyProcessDefinitionExists.get(Constants.STATUS) != 
Status.SUCCESS) {
+        if (verifyProcessDefinitionExists.get(Constants.STATUS) == 
Status.PROCESS_DEFINITION_NAME_EXIST) {

Review comment:
       Good suggestions, I would add it to codebase, thanks




-- 
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]


Reply via email to