chore: add .gitignore, clean tracked junk files
This commit is contained in:
@@ -16,6 +16,7 @@ import logging
|
||||
from logging.handlers import RotatingFileHandler
|
||||
import os
|
||||
from utils.error_handlers import ErrorHandler
|
||||
from utils.db_utils import retry_database_connection
|
||||
|
||||
def create_app():
|
||||
# 创建应用实例
|
||||
@@ -49,6 +50,12 @@ def create_app():
|
||||
|
||||
# 初始化数据库
|
||||
db.init_app(app)
|
||||
|
||||
# 确保数据库连接成功后再继续启动
|
||||
app.logger.info("正在连接数据库...")
|
||||
if not retry_database_connection(db, app):
|
||||
raise RuntimeError("无法连接到数据库,应用启动失败")
|
||||
|
||||
migrate = Migrate(app, db)
|
||||
|
||||
# 初始化异常处理器
|
||||
|
||||
Reference in New Issue
Block a user