feat:内存监控开关

This commit is contained in:
jxxghp
2025-06-06 13:49:52 +08:00
parent e42d2baf8a
commit de4973a270
4 changed files with 42 additions and 18 deletions

View File

@@ -247,6 +247,8 @@ class ConfigModel(BaseModel):
REPO_GITHUB_TOKEN: Optional[str] = None
# 大内存模式
BIG_MEMORY_MODE: bool = False
# 内存使用监控
MEMORY_MONITOR_ENABLE: bool = False
# 全局图片缓存,将媒体图片缓存到本地
GLOBAL_IMAGE_CACHE: bool = False
# 是否启用编码探测的性能模式

View File

@@ -456,6 +456,9 @@ class EventManager(metaclass=Singleton):
elif class_name.endswith("Chain"):
module_name = f"app.chain.{class_name[:-5].lower()}"
module = importlib.import_module(module_name)
elif class_name.endswith("Helper"):
module_name = f"app.helper.{class_name[:-6].lower()}"
module = importlib.import_module(module_name)
else:
module_name = f"app.{class_name.lower()}"
module = importlib.import_module(module_name)