From 4ea5e946d02b05a4637ee4f16f15c3c366a0db19 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Mon, 2 Mar 2020 16:16:50 +0100 Subject: [PATCH] If something crash, try sometime after --- app.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 7a39695..3ef18fe 100644 --- a/app.py +++ b/app.py @@ -1,3 +1,4 @@ +import time from operator import attrgetter, itemgetter from flask import redirect, render_template, request, url_for @@ -166,4 +167,9 @@ def admin_edit(link_id=None): if __name__ == '__main__': - app.run('0.0.0.0', APP_PORT, IS_DEBUG) + while True: + try: + app.run('0.0.0.0', APP_PORT, IS_DEBUG) + except Exception: + time.sleep(10) + pass