From b7e5cf97c214a86685d2be76c2c980b862242ada Mon Sep 17 00:00:00 2001 From: Benedikt Ziemons Date: Sat, 14 Nov 2020 23:26:38 +0100 Subject: [PATCH] Fix checking and set stopping event directly --- main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 504d7d3..880b522 100644 --- a/main.py +++ b/main.py @@ -66,9 +66,10 @@ class PodKeeper: pod_description = json.loads(podman.pod.inspect(self.podname)) for container in pod_description["Containers"]: if container["State"] != "running": - print(f"Container {container['name']} exited", file=sys.stderr, flush=True) - print(f"Log since last check:\n{podman.logs('--since', last_check.isoformat(), container['name'])}", file=sys.stderr, flush=True) - self.destroy() + print(f"Container {container['Name']} exited", file=sys.stderr, flush=True) + logs = podman.logs('--since', last_check.isoformat(), container['Name']) + print(f"Log since last check:\n{logs}", file=sys.stderr, flush=True) + self.stopping.set() last_check = new_timestamp if self.reloading.is_set():