fix:ruff
This commit is contained in:
@@ -111,11 +111,6 @@ class SubHeartflowManager:
|
|||||||
# 设置状态为ABSENT释放资源
|
# 设置状态为ABSENT释放资源
|
||||||
if subheartflow.chat_state.chat_status != ChatState.ABSENT:
|
if subheartflow.chat_state.chat_status != ChatState.ABSENT:
|
||||||
logger.debug(f"[子心流管理] 设置 {stream_name} 状态为ABSENT")
|
logger.debug(f"[子心流管理] 设置 {stream_name} 状态为ABSENT")
|
||||||
states_num = (
|
|
||||||
self.count_subflows_by_state(ChatState.ABSENT),
|
|
||||||
self.count_subflows_by_state(ChatState.CHAT),
|
|
||||||
self.count_subflows_by_state(ChatState.FOCUSED),
|
|
||||||
)
|
|
||||||
await subheartflow.set_chat_state(ChatState.ABSENT)
|
await subheartflow.set_chat_state(ChatState.ABSENT)
|
||||||
else:
|
else:
|
||||||
logger.debug(f"[子心流管理] {stream_name} 已是ABSENT状态")
|
logger.debug(f"[子心流管理] {stream_name} 已是ABSENT状态")
|
||||||
@@ -284,12 +279,6 @@ class SubHeartflowManager:
|
|||||||
logger.debug(f"{log_prefix} 已达专注上限 ({current_focused_count}/{focused_limit})")
|
logger.debug(f"{log_prefix} 已达专注上限 ({current_focused_count}/{focused_limit})")
|
||||||
return
|
return
|
||||||
|
|
||||||
states_num = (
|
|
||||||
self.count_subflows_by_state(ChatState.ABSENT),
|
|
||||||
self.count_subflows_by_state(ChatState.CHAT),
|
|
||||||
current_focused_count,
|
|
||||||
)
|
|
||||||
|
|
||||||
for sub_hf in list(self.subheartflows.values()):
|
for sub_hf in list(self.subheartflows.values()):
|
||||||
flow_id = sub_hf.subheartflow_id
|
flow_id = sub_hf.subheartflow_id
|
||||||
stream_name = chat_manager.get_stream_name(flow_id) or flow_id
|
stream_name = chat_manager.get_stream_name(flow_id) or flow_id
|
||||||
@@ -340,13 +329,6 @@ class SubHeartflowManager:
|
|||||||
subflows_snapshot = list(self.subheartflows.values())
|
subflows_snapshot = list(self.subheartflows.values())
|
||||||
deactivated_count = 0
|
deactivated_count = 0
|
||||||
|
|
||||||
# 预先计算状态数量,因为 set_chat_state 需要
|
|
||||||
states_num_before = (
|
|
||||||
self.count_subflows_by_state(ChatState.ABSENT),
|
|
||||||
self.count_subflows_by_state(ChatState.CHAT),
|
|
||||||
self.count_subflows_by_state(ChatState.FOCUSED),
|
|
||||||
)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for sub_hf in subflows_snapshot:
|
for sub_hf in subflows_snapshot:
|
||||||
flow_id = sub_hf.subheartflow_id
|
flow_id = sub_hf.subheartflow_id
|
||||||
|
|||||||
Reference in New Issue
Block a user