From eec43dbfd59c8d8acd1e4564dd2447007984afa9 Mon Sep 17 00:00:00 2001 From: yhjun1026 <460342015@qq.com> Date: Wed, 14 Jun 2023 21:46:30 +0800 Subject: [PATCH] async auto load plugin --- pilot/common/plugins.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pilot/common/plugins.py b/pilot/common/plugins.py index 49c79c4d6..53604fc5c 100644 --- a/pilot/common/plugins.py +++ b/pilot/common/plugins.py @@ -79,8 +79,7 @@ def load_native_plugins(cfg: Config): print("not auto load_native_plugins") return def load_from_git(cfg: Config): - print("load_native_plugins") - ### TODO 默认拉主分支,后续拉发布版本 + print("async load_native_plugins") branch_name = cfg.plugins_git_branch native_plugin_repo = "DB-GPT-Plugins" url = "https://github.com/csunny/{repo}/archive/{branch}.zip" @@ -98,10 +97,10 @@ def load_native_plugins(cfg: Config): print(file_name) with open(file_name, "wb") as f: f.write(response.content) - print("文件已保存到本地") + print("save file") cfg.set_plugins(scan_plugins(cfg, cfg.debug_mode)) else: - print("获取Release信息失败,状态码为:", response.status_code) + print("get file faild,response code:", response.status_code) # 创建一个线程 t = threading.Thread(target=load_from_git, args=(cfg,))