Merge branch 'main' of gitee.com:wg123/video-gen into main

This commit is contained in:
18610128193
2026-06-22 10:14:20 +08:00
8 changed files with 704 additions and 62 deletions
+7
View File
@@ -63,6 +63,11 @@ async def lifespan(app: FastAPI):
from app.tasks.token_refresh_task import token_refresh_scheduler
token_refresh_task = asyncio.create_task(token_refresh_scheduler())
# 启动上传队列(异步处理素材上传)
from app.services.upload_queue import upload_queue
await upload_queue.recover()
upload_queue_task = asyncio.create_task(upload_queue.run())
# 启动时立即同步一次未支付订单
asyncio.create_task(asyncio.sleep(5)) # 等待5秒后再同步,让系统完全启动
async def startup_sync():
@@ -87,6 +92,8 @@ async def lifespan(app: FastAPI):
await queue_task
expiry_task.cancel()
token_refresh_task.cancel()
upload_queue.stop()
await upload_queue_task
await close_database()
await close_redis()