From 49f4ab0ec80c19032b514f00b4d60bd64ea7a5ca Mon Sep 17 00:00:00 2001 From: Rock Chin <1010553892@qq.com> Date: Mon, 6 Mar 2023 12:34:08 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=AE=8C=E6=95=B4=E6=80=A7=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E5=BF=BD=E7=95=A5=5F=5F=E5=BC=80=E5=A4=B4=E7=9A=84?= =?UTF-8?q?=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index c5aded9..24b8eec 100644 --- a/main.py +++ b/main.py @@ -129,11 +129,15 @@ def main(first_time_init=False): config = importlib.import_module('config') - #配置完整性校验 + init_runtime_log_file() + + sh = reset_logging() + + # 配置完整性校验 is_integrity = True config_template = importlib.import_module('config-template') for key in dir(config_template): - if not hasattr(config, key): + if not key.startswith("__") and not hasattr(config, key): setattr(config, key, getattr(config_template, key)) logging.warning("[{}]不存在".format(key)) is_integrity = False @@ -145,10 +149,6 @@ def main(first_time_init=False): import pkg.utils.context pkg.utils.context.set_config(config) - init_runtime_log_file() - - sh = reset_logging() - # 检查是否设置了管理员 if not (hasattr(config, 'admin_qq') and config.admin_qq != 0): # logging.warning("未设置管理员QQ,管理员权限指令及运行告警将无法使用,如需设置请修改config.py中的admin_qq字段")