Skip to content

Commit 6c1f68e

Browse files
authored
Update opera log cost time precision (#479)
1 parent 78dad30 commit 6c1f68e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backend/middleware/opera_log_middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async def dispatch(self, request: Request, call_next) -> Response:
4242
start_time = timezone.now()
4343
request_next = await self.execute_request(request, call_next)
4444
end_time = timezone.now()
45-
cost_time = (end_time - start_time).total_seconds() * 1000.0
45+
cost_time = round((end_time - start_time).total_seconds() * 1000.0, 3)
4646

4747
# 此信息只能在请求后获取
4848
_route = request.scope.get('route')

0 commit comments

Comments
 (0)