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
8 changes: 4 additions & 4 deletions lightllm/server/httpserver/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ async def _wait_to_token_package(
return

async def abort(self, group_req_id: int):
req_status: ReqStatus = self.req_id_to_out_inf.get(group_req_id, default=None)
req_status: ReqStatus = self.req_id_to_out_inf.get(group_req_id, None)
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 default parameter in dict.get() is positional-only. Passing None as a positional argument is the correct way to specify a default value when the key is not found.

if req_status is None:
logger.warning(f"aborted group_request_id {group_req_id} not exist")
return
Expand All @@ -599,7 +599,7 @@ async def recycle_resource_loop(self):
# 清理已经处理完的可以删除的请求
release_req_status: List[ReqStatus] = []
for group_req_id_ in list(self.req_id_to_out_inf.keys()):
req_status: ReqStatus = self.req_id_to_out_inf.get(group_req_id_, default=None)
req_status: ReqStatus = self.req_id_to_out_inf.get(group_req_id_, None)
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 default parameter in dict.get() is positional-only. Passing None as a positional argument is the correct way to specify a default value when the key is not found.

if req_status is not None and req_status.can_release():
release_req_status.append(req_status)

Expand All @@ -614,7 +614,7 @@ async def recycle_resource_loop(self):
if time.time() - pre_time_mark > 120:
pre_time_mark = time.time()
for group_req_id_ in list(self.req_id_to_out_inf.keys()):
req_status: ReqStatus = self.req_id_to_out_inf.get(group_req_id_, default=None)
req_status: ReqStatus = self.req_id_to_out_inf.get(group_req_id_, None)
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 default parameter in dict.get() is positional-only. Passing None as a positional argument is the correct way to specify a default value when the key is not found.

if req_status is None:
continue

Expand Down Expand Up @@ -646,7 +646,7 @@ async def handle_loop(self):
pass

for group_req_id_ in list(self.req_id_to_out_inf.keys()):
req_status = self.req_id_to_out_inf.get(group_req_id_, default=None)
req_status = self.req_id_to_out_inf.get(group_req_id_, None)
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 default parameter in dict.get() is positional-only. Passing None as a positional argument is the correct way to specify a default value when the key is not found.

if req_status is None:
continue

Expand Down