This commit is contained in:
2026-07-20 14:01:22 +08:00
parent 53e01f6f74
commit a2e98ef3a3
75 changed files with 5912 additions and 2666 deletions
+2 -9
View File
@@ -31,11 +31,6 @@ async def lifespan(app: FastAPI):
await init_redis()
# await _seed_data()
# Start task queue (handles both video and image generation)
from app.services.video_queue import task_queue
await task_queue.recover()
queue_task = asyncio.create_task(task_queue.run())
# Background task: auto-expire pending payment orders and sync status
async def _order_expiry_loop():
from app.services.payment import expire_all_pending_orders, sync_pending_orders
@@ -104,8 +99,6 @@ async def lifespan(app: FastAPI):
yield
task_queue.stop()
await queue_task
upload_queue.stop()
await upload_queue_task
pre_test_queue.stop()
@@ -315,7 +308,7 @@ async def _seed_data():
default_video_engine_result = await db.execute(
select(VideoEngine)
.where(VideoEngine.is_active == True)
.where(VideoEngine.is_active == True, VideoEngine.deleted_at.is_(None))
.order_by(VideoEngine.priority.desc(), VideoEngine.id.desc())
.limit(1)
)
@@ -348,7 +341,7 @@ async def _seed_data():
default_image_engine_result = await db.execute(
select(ImageEngine)
.where(ImageEngine.is_active == True)
.where(ImageEngine.is_active == True, ImageEngine.deleted_at.is_(None))
.order_by(ImageEngine.priority.desc(), ImageEngine.id.desc())
.limit(1)
)