🤖 自动格式化代码 [skip ci]

This commit is contained in:
github-actions[bot]
2025-05-16 09:35:00 +00:00
parent e4f7c1fe62
commit 335c62c50f
2 changed files with 1 additions and 7 deletions

View File

@@ -391,11 +391,7 @@ class EmojiManager:
# if not self._initialized: # if not self._initialized:
# try: # try:
# # Ensure Peewee database connection is up and tables are created # # Ensure Peewee database connection is up and tables are created
# self._initialized = True # self._initialized = True
# except Exception as e: # except Exception as e:
# logger.exception(f"初始化表情管理器失败: {e}") # logger.exception(f"初始化表情管理器失败: {e}")

View File

@@ -336,9 +336,7 @@ def initialize_database():
model_fields = model._meta.fields model_fields = model._meta.fields
for field_name in model_fields: for field_name in model_fields:
if field_name not in existing_columns: if field_name not in existing_columns:
logger.error( logger.error(f"'{table_name}' 缺失字段 '{field_name}',请手动迁移数据库结构后重启程序。")
f"'{table_name}' 缺失字段 '{field_name}',请手动迁移数据库结构后重启程序。"
)
sys.exit(1) sys.exit(1)
except Exception as e: except Exception as e:
logger.exception(f"检查表或字段是否存在时出错: {e}") logger.exception(f"检查表或字段是否存在时出错: {e}")