feat(douyu): 落地账号平台同步与登录配额

This commit is contained in:
yml
2026-11-21 21:27:14 +08:00
parent 72bc346c9b
commit 1d262cdfd9
30 changed files with 3087 additions and 85 deletions
+4
View File
@@ -60,6 +60,7 @@ async def lifespan(app: FastAPI):
from .database import SessionLocal, dispose_engines
from .services.douyu_service import cleanup_orphan_douyu_tasks
from .services.huya_service import cleanup_orphan_huya_tasks
from .services.login_quota_service import cleanup_orphan_login_attempts
from .services.login_service import (
cleanup_orphan_login_tasks,
cleanup_orphan_relogin_tasks,
@@ -84,6 +85,9 @@ async def lifespan(app: FastAPI):
cleaned_login = cleanup_orphan_login_tasks(db)
if cleaned_login:
logger.info(f"启动清理登录残留任务: {cleaned_login} 条")
cleaned_attempts = cleanup_orphan_login_attempts(db)
if cleaned_attempts:
logger.info(f"启动收敛中断的登录尝试流水: {cleaned_attempts} 条")
from .services.yyb_service import cleanup_orphan_yyb_tasks
cleaned_yyb = cleanup_orphan_yyb_tasks(db, message="任务已中断(服务重启)")