From 210c5e31519250c9d8c84bd7ef5d7aa00b32cb19 Mon Sep 17 00:00:00 2001 From: InfinityPacer <160988576+InfinityPacer@users.noreply.github.com> Date: Wed, 2 Oct 2024 16:22:28 +0800 Subject: [PATCH] feat(plugin): broadcast PluginReload event when plugin reload --- app/core/plugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/core/plugin.py b/app/core/plugin.py index dc03ff99..57da9cd2 100644 --- a/app/core/plugin.py +++ b/app/core/plugin.py @@ -19,7 +19,7 @@ from app.helper.module import ModuleHelper from app.helper.plugin import PluginHelper from app.helper.sites import SitesHelper from app.log import logger -from app.schemas.types import SystemConfigKey +from app.schemas.types import SystemConfigKey, EventType from app.utils.crypto import RSAUtils from app.utils.limit import rate_limit_window from app.utils.object import ObjectUtils @@ -268,6 +268,8 @@ class PluginManager(metaclass=Singleton): self.stop(plugin_id) # 重新加载 self.start(plugin_id) + # 广播事件 + eventmanager.send_event(EventType.PluginReload, data={"plugin_id": plugin_id}) def sync(self): """