新增更新token,提交素材,前测模板管理

This commit is contained in:
18610128193
2026-06-18 17:44:21 +08:00
parent c8ad49c736
commit 11f424a333
9 changed files with 648 additions and 62 deletions
+5
View File
@@ -59,6 +59,10 @@ async def lifespan(app: FastAPI):
expiry_task = asyncio.create_task(_order_expiry_loop())
# 启动token刷新定时任务(每5分钟检查一次,小于800秒有效期的token进行刷新)
from app.tasks.token_refresh_task import token_refresh_scheduler
token_refresh_task = asyncio.create_task(token_refresh_scheduler())
# 启动时立即同步一次未支付订单
asyncio.create_task(asyncio.sleep(5)) # 等待5秒后再同步,让系统完全启动
async def startup_sync():
@@ -82,6 +86,7 @@ async def lifespan(app: FastAPI):
task_queue.stop()
await queue_task
expiry_task.cancel()
token_refresh_task.cancel()
await close_database()
await close_redis()