依旧pyright错误喵~
This commit is contained in:
8
bot.py
8
bot.py
@@ -296,8 +296,10 @@ class DatabaseManager:
|
||||
# 使用线程执行器运行潜在的阻塞操作
|
||||
await initialize_sql_database()
|
||||
elapsed_time = time.time() - start_time
|
||||
|
||||
db_type = global_config.database.database_type if global_config else "unknown"
|
||||
logger.info(
|
||||
f"数据库连接初始化成功,使用 {global_config.database.database_type} 数据库,耗时: {elapsed_time:.2f}秒"
|
||||
f"数据库连接初始化成功,使用 {db_type} 数据库,耗时: {elapsed_time:.2f}秒"
|
||||
)
|
||||
|
||||
return self
|
||||
@@ -321,6 +323,10 @@ class ConfigurationValidator:
|
||||
try:
|
||||
from src.config.config import global_config
|
||||
|
||||
if global_config is None:
|
||||
logger.error("全局配置未初始化")
|
||||
return False
|
||||
|
||||
# 检查必要的配置节
|
||||
required_sections = ["database", "bot"]
|
||||
for section in required_sections:
|
||||
|
||||
Reference in New Issue
Block a user