Skip to content

Commit

Permalink
Merge "Stop running process"
Browse files Browse the repository at this point in the history
  • Loading branch information
mduft authored and Gerrit Code Review committed Nov 21, 2022
2 parents d85c9c8 + e10e0f1 commit 1972ced
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
import io.bdeploy.interfaces.configuration.pcu.InstanceStatusDto;
import io.bdeploy.interfaces.configuration.pcu.ProcessControlGroupConfiguration;
import io.bdeploy.interfaces.configuration.pcu.ProcessDetailDto;
import io.bdeploy.interfaces.configuration.pcu.ProcessState;
import io.bdeploy.interfaces.configuration.pcu.ProcessStatusDto;
import io.bdeploy.interfaces.configuration.system.SystemConfiguration;
import io.bdeploy.interfaces.descriptor.application.ProcessControlDescriptor.ApplicationStartType;
Expand Down Expand Up @@ -926,8 +927,9 @@ public void stop(String instanceId, List<String> applicationIds) {
for (var applicationId : applicationIds) {
// Find node where the application is running
Optional<String> node = status.node2Applications.entrySet().stream()
.filter(e -> e.getValue().hasApps() && e.getValue().getStatus(applicationId) != null).map(Entry::getKey)
.findFirst();
.filter(e -> e.getValue().hasApps() && e.getValue().getStatus(applicationId) != null
&& e.getValue().getStatus(applicationId).processState != ProcessState.STOPPED)
.map(Entry::getKey).findFirst();

if (node.isEmpty()) {
continue; // ignore - not deployed.
Expand Down

0 comments on commit 1972ced

Please sign in to comment.