From 2c3a05a056c209b6b1da5855c2a729b43b18708a Mon Sep 17 00:00:00 2001 From: flifloo Date: Sun, 27 Oct 2019 21:40:47 +0100 Subject: [PATCH] On start wait the clean of the logs to avoid old logs on first requests --- app/routes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/routes.py b/app/routes.py index ef21341..53b6c81 100644 --- a/app/routes.py +++ b/app/routes.py @@ -78,6 +78,9 @@ def start(): while server.isalive(): sleep(1) start() # Start again the server + # Wait the log file to be archived + while open(Path(conf["Path"])/"logs"/"latest.log", "r").read() != "": + sleep(1) return "Ok" else: abort(400, "Server is running")