Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lightllm/server/visualserver/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ async def loop_for_netio_req(self):
self.waiting_reqs.append(recv_req)
else:
assert False, f"Error Req Inf {recv_req}"
self.visual_recv_max_count = min(self.visual_recv_max_count * 1.3, 256)
self.visual_recv_max_count = int(min(self.visual_recv_max_count * 1.3, 256))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The values 1.3 and 256 are magic numbers. To improve readability and maintainability, consider defining them as named constants (e.g., VISUAL_RECV_MAX_COUNT_GROWTH_FACTOR and VISUAL_RECV_MAX_COUNT_LIMIT) at the class or module level. The value 64 used for initialization and reset of visual_recv_max_count on lines 185 and 202 could also be defined as a constant.

except zmq.ZMQError:
# 当队列已经开始清空的时候,将一次接受数量下调
self.visual_recv_max_count = 64
Expand Down
Loading