From 3649061c15f8e24f1e5a4d2f9d03b37884c89a63 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Mon, 19 Sep 2022 16:02:21 +0100 Subject: [PATCH] feat(chalice): conditional log --- ee/api/app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ee/api/app.py b/ee/api/app.py index 9f2f9a306..ad9310f95 100644 --- a/ee/api/app.py +++ b/ee/api/app.py @@ -35,7 +35,9 @@ async def or_middleware(request: Request, call_next): now = int(time.time() * 1000) response: StreamingResponse = await call_next(request) if helper.TRACK_TIME: - print(f"Execution time: {int(time.time() * 1000) - now} ms") + now = int(time.time() * 1000) - now + if now > 500: + print(f"Execution time: {now} ms") except Exception as e: pg_client.close() raise e