You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by of...@apache.org on 2019/11/05 14:01:33 UTC

[incubator-dlab] 01/01: [DLAB-1233] Fixed bug with disconnecting project endpoint[Quota]

This is an automated email from the ASF dual-hosted git repository.

ofuks pushed a commit to branch DLAB-1233
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit ea9265f6232b925a6474668d209624612a5985af
Author: Oleh Fuks <ol...@gmail.com>
AuthorDate: Tue Nov 5 16:00:54 2019 +0200

    [DLAB-1233] Fixed bug with disconnecting project endpoint[Quota]
---
 .../epam/dlab/backendapi/service/impl/EnvironmentServiceImpl.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EnvironmentServiceImpl.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EnvironmentServiceImpl.java
index 2125398..5737497 100644
--- a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EnvironmentServiceImpl.java
+++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EnvironmentServiceImpl.java
@@ -127,9 +127,11 @@ public class EnvironmentServiceImpl implements EnvironmentService {
 		checkProjectResourceConditions(project, "stop");
 		exploratoryDAO.fetchRunningExploratoryFieldsForProject(project)
 				.forEach(this::stopNotebook);
-		/*if (projectService.get(project).getStatus() == ProjectDTO.Status.ACTIVE) {
-			projectService.stop(systemUserInfoService.create("admin"), project);
-		}*/
+
+		projectService.get(project).getEndpoints().stream()
+				.filter(e -> UserInstanceStatus.RUNNING == e.getStatus())
+				.forEach(endpoint -> projectService.stop(securityService.getServiceAccountInfo("admin"),
+						endpoint.getName(), project));
 	}
 
 	@Override


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org