From 1a51e8c734045d79fc7e0ab09c25a39e577ee3b9 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 31 Mar 2023 13:58:33 +0200 Subject: [PATCH] Optimized docker-compose-restart-unhealthy performance --- .../files/docker-compose-restart-unhealthy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/native-docker-compose-restart-unhealthy/files/docker-compose-restart-unhealthy.py b/roles/native-docker-compose-restart-unhealthy/files/docker-compose-restart-unhealthy.py index 2ba4e013..7e0dee99 100644 --- a/roles/native-docker-compose-restart-unhealthy/files/docker-compose-restart-unhealthy.py +++ b/roles/native-docker-compose-restart-unhealthy/files/docker-compose-restart-unhealthy.py @@ -26,14 +26,14 @@ def print_bash(command): print(list_to_string(output)) return output -waiting_time=1800 +waiting_time=600 backup_running=True while backup_running: - print("stop program for " + str(waiting_time) + "seconds.") - time.sleep(waiting_time) try: bash("systemctl is-active --quiet docker-volume-backup.service") print("backup is running.") + print("trying again in " + str(waiting_time) + " seconds.") + time.sleep(waiting_time) except: backup_running=False print("no backup is running.")