From b95d81405dcdc71daa39ad6a156f39c934216e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=20=E6=9F=8F?= Date: Sat, 1 Feb 2025 21:22:14 +0900 Subject: [PATCH] update operation log --- backend/app/core/operation.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/app/core/operation.py b/backend/app/core/operation.py index fdd8e56..bc60167 100644 --- a/backend/app/core/operation.py +++ b/backend/app/core/operation.py @@ -49,7 +49,8 @@ class LoggingMiddleware(BaseHTTPMiddleware): db = request.state.db if db: - await self.write_log_to_db(db_operation,db) + await self.write_log_to_db(db_operation,db) + except Exception as e: print(f"Logging failed: {str(e)}") @@ -64,5 +65,6 @@ class LoggingMiddleware(BaseHTTPMiddleware): async def write_log_to_db(self, db_operation,db): db.add(db_operation) - db.commit() + await db.commit() + \ No newline at end of file