Skip to content

Commit 08d0206

Browse files
committed
Fix check if server exists
1 parent d8ee5a3 commit 08d0206

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

bot/src/main/java/de/chojo/gamejam/server/DockerService.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,11 @@ public void sendCommand(int teamId, String command) {
114114
public boolean exists(int teamId) {
115115
return dockerClient.listContainersCmd()
116116
.withShowAll(true)
117+
.withNameFilter(List.of(containerName(teamId)))
117118
.exec()
118119
.stream()
119-
.anyMatch(container -> container.getId().startsWith(containerName(teamId)));
120+
.findAny()
121+
.isPresent();
120122
}
121123

122124
public Optional<Container> container(int teamId) {

0 commit comments

Comments
 (0)