剥离无效事件系统并收口插件统计链路
- 删除未被实际消费的事件系统实现与相关发布逻辑 - 将插件调用统计改为在机器人主链路中直接埋点记录 - 重构统计收集插件初始化与记录方式,移除事件总线依赖 - 同步更新工程优化文档中的性能与链路治理描述
This commit is contained in:
@@ -12,7 +12,6 @@ from base.plugin_common.plugin_interface import PluginInterface, PluginStatus
|
||||
from base.plugin_common.message_plugin_interface import MessagePluginInterface
|
||||
from base.plugin_common.scheduled_plugin_interface import ScheduledPluginInterface
|
||||
from base.plugin_common.plugin_registry import PluginRegistry
|
||||
from base.plugin_common.event_system import EventSystem, EventType
|
||||
from utils.decorator.async_job import async_job
|
||||
from wechat_ipad import WechatAPIClient
|
||||
|
||||
@@ -431,9 +430,6 @@ class PluginManager:
|
||||
self._refresh_module_file_state(module_name)
|
||||
# self.LOG.info(f"PluginManager:添加模块映射 {module_name} -> {display_name}")
|
||||
|
||||
# 发布插件加载事件
|
||||
EventSystem().publish(EventType.PLUGIN_LOADED, {"plugin": plugin})
|
||||
|
||||
return plugin
|
||||
else:
|
||||
self.LOG.error(f"PluginManager:插件模块 {module_name} 的 get_plugin() 返回的不是有效的插件实例")
|
||||
@@ -483,9 +479,6 @@ class PluginManager:
|
||||
self._refresh_module_file_state(module_name)
|
||||
# self.LOG.info(f"PluginManager:添加模块映射 {module_name} -> {display_name}")
|
||||
|
||||
# 发布插件加载事件
|
||||
EventSystem().publish(EventType.PLUGIN_LOADED, {"plugin": plugin})
|
||||
|
||||
return plugin
|
||||
|
||||
except Exception as e:
|
||||
@@ -544,9 +537,6 @@ class PluginManager:
|
||||
# 移除插件实例
|
||||
del self.plugins[display_name]
|
||||
|
||||
# 发布插件卸载事件
|
||||
EventSystem().publish(EventType.PLUGIN_UNLOADED, {"plugin_name": display_name})
|
||||
|
||||
return True
|
||||
|
||||
def reload_plugin(self, name: str) -> Optional[PluginInterface]:
|
||||
|
||||
Reference in New Issue
Block a user