From 74e639737edd78ebc1dd3481837aa3bdf1f4d505 Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 21 Feb 2024 18:03:02 +0300 Subject: [PATCH] profiling-fix-2 --- services/db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/db.py b/services/db.py index 140357a2..2b9cdc02 100644 --- a/services/db.py +++ b/services/db.py @@ -57,7 +57,7 @@ def after_cursor_execute(conn, cursor, statement, parameters, context, executema elapsed = time.time() - conn._query_start_time del conn._query_start_time if elapsed > 0.2: # Adjust threshold as needed - print(f"{'*' * math.floor(elapsed)} {elapsed:.3f} seconds to execute.") + logger.debug(f"{'*' * math.floor(elapsed)} {elapsed:.3f} seconds to execute.") # Profile the query if execution time exceeds the threshold profiler = profile_sqlalchemy_queries(threshold=0.2)(cursor.execute) profiler(statement, parameters)