From 4281692321298ee5a1b8e42e924f1898458ce5cf Mon Sep 17 00:00:00 2001 From: thsrite Date: Tue, 14 May 2024 09:24:02 +0800 Subject: [PATCH] =?UTF-8?q?fix=20add=E6=8F=92=E4=BB=B6=E7=83=AD=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E5=8F=98=E9=87=8F=E5=BC=80=E5=85=B3=EF=BC=88=E4=BF=9D?= =?UTF-8?q?=E7=95=99DEV=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + app/core/config.py | 2 ++ app/core/plugin.py | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 36e397d6..d1e6c5f2 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,7 @@ MoviePilot需要配套下载器和媒体服务器配合使用。 - **META_CACHE_EXPIRE:** 元数据识别缓存过期时间(小时),数字型,不配置或者配置为0时使用系统默认(大内存模式为7天,否则为3天),调大该值可减少themoviedb的访问次数 - **GITHUB_TOKEN:** Github token,提高自动更新、插件安装等请求Github Api的限流阈值,格式:ghp_**** - **DEV:** 开发者模式,`true`/`false`,默认`false`,仅用于本地开发使用,开启后会暂停所有定时任务,且插件代码文件的修改无需重启会自动重载生效 +- **PLUGIN_AUTO_RELOAD:** 插件热加载,`true`/`false`,默认`false`,开启后插件代码文件的修改无需重启会自动重载生效 - **AUTO_UPDATE_RESOURCE**:启动时自动检测和更新资源包(站点索引及认证等),`true`/`false`,默认`true`,需要能正常连接Github,仅支持Docker镜像 --- - **TMDB_API_DOMAIN:** TMDB API地址,默认`api.themoviedb.org`,也可配置为`api.tmdb.org`、`tmdb.movie-pilot.org` 或其它中转代理服务地址,能连通即可 diff --git a/app/core/config.py b/app/core/config.py index 15fc99f5..6db31dbe 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -33,6 +33,8 @@ class Settings(BaseSettings): DEBUG: bool = False # 是否开发模式 DEV: bool = False + # 是否开启插件热加载 + PLUGIN_AUTO_RELOAD: bool = False # 配置文件目录 CONFIG_DIR: Optional[str] = None # 超级管理员 diff --git a/app/core/plugin.py b/app/core/plugin.py index cf0b23af..e6b9648a 100644 --- a/app/core/plugin.py +++ b/app/core/plugin.py @@ -97,7 +97,7 @@ class PluginManager(metaclass=Singleton): self.pluginhelper = PluginHelper() self.systemconfig = SystemConfigOper() # 开发者模式监测插件修改 - if settings.DEV: + if settings.DEV or settings.PLUGIN_AUTO_RELOAD: self.__start_monitor() def init_config(self):