summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/libertacasa
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/libertacasa')
-rw-r--r--src/main/java/net/libertacasa/pubsh/web/SchedulerBean.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/net/libertacasa/pubsh/web/SchedulerBean.java b/src/main/java/net/libertacasa/pubsh/web/SchedulerBean.java
index 26408df..135a424 100644
--- a/src/main/java/net/libertacasa/pubsh/web/SchedulerBean.java
+++ b/src/main/java/net/libertacasa/pubsh/web/SchedulerBean.java
@@ -29,9 +29,13 @@ public class SchedulerBean {
return Tasks.oneTime("shell-removal")
.execute((instance, ctx) -> {
System.out.printf("Running container removal task - Instance: %s, ctx: %s\n", instance, ctx);
- String username = instance.getId().split("&")[0];
- String containerid = instance.getId().split("&")[1];
- Docker.deleteShell(username, containerid);
+ try {
+ String username = instance.getId().split("&")[0];
+ String containerid = instance.getId().split("&")[1];
+ Docker.deleteShell(username, containerid);
+ } catch (com.github.dockerjava.api.exception.NotFoundException exception) {
+ System.out.printf("Container does not exist\n");
+ }
});
}