From ab48396db93c3beb1b984876164e61325c638e4d Mon Sep 17 00:00:00 2001 From: snowy Date: Mon, 5 Aug 2024 07:13:41 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E6=95=B0=E6=8D=AE=E5=BA=93=E6=9C=AA?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E8=BF=81=E7=A7=BB=E5=89=8D=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/__init__.py | 3 +-- src/utils/base/data_manager.py | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/__init__.py b/src/utils/__init__.py index 03772f11..b69bae9b 100644 --- a/src/utils/__init__.py +++ b/src/utils/__init__.py @@ -13,7 +13,7 @@ import requests from src.utils.base.config import load_from_yaml, config from src.utils.base.log import init_log -from src.utils.base.data_manager import TempConfig, auto_migrate, common_db +from src.utils.base.data_manager import TempConfig, common_db from git import Repo @@ -53,7 +53,6 @@ def init(): """ # 检测python版本是否高于3.10 - auto_migrate() init_log() if sys.version_info < (3, 10): nonebot.logger.error("Requires Python3.10+ to run, please upgrade your Python Environment.") diff --git a/src/utils/base/data_manager.py b/src/utils/base/data_manager.py index 63d510c7..f7d5647a 100644 --- a/src/utils/base/data_manager.py +++ b/src/utils/base/data_manager.py @@ -68,6 +68,9 @@ def auto_migrate(): common_db.auto_migrate(GlobalPlugin(), StoredConfig(), TempConfig()) +auto_migrate() + + def set_memory_data(key: str, value) -> None: """ 设置内存数据库的数据,类似于redis