You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@datalab.apache.org by GitBox <gi...@apache.org> on 2020/11/17 14:32:08 UTC

[GitHub] [incubator-datalab] ofuks commented on a change in pull request #982: [DATALAB-2130] Fixed double terminating for edge node during endpoint disconnection

ofuks commented on a change in pull request #982:
URL: https://github.com/apache/incubator-datalab/pull/982#discussion_r525190880



##########
File path: README.md
##########
@@ -2143,6 +2143,7 @@ mongoimport -u admin -p <password> -d <database_name> -c settings mongo_settings
 mongoimport -u admin -p <password> -d <database_name> --jsonArray -c roles mongo_roles.json
 ```
 
+

Review comment:
       Do we need this empty line here?

##########
File path: services/self-service/src/main/java/com/epam/datalab/backendapi/service/impl/EndpointServiceImpl.java
##########
@@ -156,7 +157,10 @@ public void removeEndpoint(@User UserInfo userInfo, @ResourceName String name, C
 
     @Override
     public void removeEndpointInAllProjects(UserInfo userInfo, String endpointName, List<ProjectDTO> projects) {
-        projects.forEach(project -> projectService.terminateEndpoint(userInfo, endpointName, project.getName()));
+        projects.stream()
+                .filter(p -> p.getEndpoints().stream()
+                  .noneMatch(e->e.getName().equals(endpointName) && e.getStatus().equals(UserInstanceStatus.TERMINATED)))

Review comment:
       1. Please reformat the code
   2. Can we use **equals** for enum?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@datalab.apache.org
For additional commands, e-mail: dev-help@datalab.apache.org