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