update operation log
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user