🎨 : 代码优化

This commit is contained in:
HibiKier 2024-07-20 00:45:26 +08:00
parent 4b48fc2557
commit d45baaddbc
2 changed files with 4 additions and 3 deletions

View File

@ -4,8 +4,7 @@ import nonebot
from nonebot import get_loaded_plugins
from nonebot.drivers import Driver
from nonebot.plugin import Plugin
from ruamel import yaml
from ruamel.yaml import YAML, round_trip_dump, round_trip_load
from ruamel.yaml import YAML
from ruamel.yaml.comments import CommentedMap
from zhenxun.configs.config import Config

View File

@ -80,10 +80,12 @@ async def init():
# await TestSQL.raw(sql)
except Exception as e:
logger.debug(f"执行SQL: {sql} 错误...", e=e)
if sql_list:
logger.debug("SCRIPT_METHOD方法执行完毕!")
await Tortoise.generate_schemas()
logger.info(f"Database loaded successfully!")
except Exception as e:
raise Exception(f"数据库连接错误...", e=e)
raise Exception(f"数据库连接错误...")
async def disconnect():