From 94a254474c1db39b3d25aa289b34aca4dec5005f Mon Sep 17 00:00:00 2001 From: Khushal P Soonderji Date: Wed, 28 May 2025 18:26:13 +0530 Subject: [PATCH] (20250528) Trying not to wait for API-level logging. --- utils_v2/api/async_quart.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/utils_v2/api/async_quart.py b/utils_v2/api/async_quart.py index 2bcabe3..08a8fc9 100644 --- a/utils_v2/api/async_quart.py +++ b/utils_v2/api/async_quart.py @@ -912,10 +912,14 @@ def log_request_to_mongo( # Write the log: app_attr = getattr(current_app, attr_name) - inserted_id = await app_attr.insert_one( + # inserted_id = await app_attr.insert_one( + # collection = collection, + # document = api_log.model_dump() + # ) + asyncio.create_task(app_attr.insert_one( collection = collection, document = api_log.model_dump() - ) + )) # Return the response from the wrapped function. if (