From bae347592692b86394168717aabd949e5c6aeee5 Mon Sep 17 00:00:00 2001 From: wyw <3151160463@qq.com> Date: Fri, 5 Dec 2025 19:25:01 +0800 Subject: [PATCH] [BugFix]Fix plugin loading logic and logging messages (#4909) * Fix plugin loading logic and logging messages * Fix indentation in plugin loading logic --------- Co-authored-by: gaoziyuan <88373061+gzy19990617@users.noreply.github.com> Co-authored-by: Yuanle Liu --- fastdeploy/plugins/utils.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fastdeploy/plugins/utils.py b/fastdeploy/plugins/utils.py index 572b1a157..2cb897108 100644 --- a/fastdeploy/plugins/utils.py +++ b/fastdeploy/plugins/utils.py @@ -41,15 +41,14 @@ def load_plugins_by_group(group: str) -> dict[str, Callable[[], Any]]: if allowed_plugins is None: logger.info( - "All plugins in this group will be loaded. " "You can set `FD_PLUGINS` to control which plugins to load." + "All plugins in this group is not allowed. " "You can set `FD_PLUGINS` to control which plugins to load." ) + return {} plugins = dict[str, Callable[[], Any]]() for plugin in discovered_plugins: - if allowed_plugins is None or plugin.name in allowed_plugins: - if allowed_plugins is not None: - logger.info("Loading plugin %s", plugin.name) - + if plugin.name in allowed_plugins: + logger.info("Loading plugin %s", plugin.name) try: func = plugin.load() plugins[plugin.name] = func