Skip to content

Commit 35e0273

Browse files
committed
apply bot suggestions
1 parent 753756d commit 35e0273

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

astrbot/core/star/star_manager.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,10 @@ async def load(
538538
"traceback": error_trace,
539539
}
540540
if path in star_map:
541-
logger.info("失败插件依旧在插件列表中")
542-
star_map.pop(path)
541+
logger.info("失败插件依旧在插件列表中,正在清理...")
542+
metadata = star_map.pop(path)
543+
if metadata in star_registry:
544+
star_registry.remove(metadata)
543545
continue
544546

545547
# 检查 _conf_schema.json
@@ -793,6 +795,11 @@ async def load(
793795
"traceback": errors,
794796
}
795797
# 记录注册失败的插件名称,以便后续重载插件
798+
if path in star_map:
799+
logger.info("失败插件依旧在插件列表中,正在清理...")
800+
metadata = star_map.pop(path)
801+
if metadata in star_registry:
802+
star_registry.remove(metadata)
796803

797804
# 清除 pip.main 导致的多余的 logging handlers
798805
for handler in logging.root.handlers[:]:

0 commit comments

Comments
 (0)