update operation log

This commit is contained in:
2025-02-01 21:22:14 +09:00
parent f70a2cfde6
commit b95d81405d

View File

@@ -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()