Optimized docker-compose-restart-unhealthy performance

This commit is contained in:
Kevin Veen-Birkenbach 2023-03-31 13:58:33 +02:00
parent d159457e65
commit d56b5847a2

View File

@ -26,14 +26,14 @@ def print_bash(command):
print(list_to_string(output)) print(list_to_string(output))
return output return output
waiting_time=1800 waiting_time=600
backup_running=True backup_running=True
while backup_running: while backup_running:
print("stop program for " + str(waiting_time) + "seconds.")
time.sleep(waiting_time)
try: try:
bash("systemctl is-active --quiet docker-volume-backup.service") bash("systemctl is-active --quiet docker-volume-backup.service")
print("backup is running.") print("backup is running.")
print("trying again in " + str(waiting_time) + " seconds.")
time.sleep(waiting_time)
except: except:
backup_running=False backup_running=False
print("no backup is running.") print("no backup is running.")