perf(douyu): 拆分任务槽并改造绑定扫码调度

This commit is contained in:
yml
2026-11-20 22:03:20 +08:00
parent 8869e427d2
commit 071d45ad1d
40 changed files with 1635 additions and 245 deletions
+8
View File
@@ -101,6 +101,10 @@ async def lifespan(app: FastAPI):
register_default_jobs()
start_scheduler()
from .services.binding_poll_scheduler import (
start_binding_poll_scheduler,
stop_binding_poll_scheduler,
)
from .services.integration import (
start_integration_outbox_worker,
stop_integration_outbox_worker,
@@ -113,17 +117,21 @@ async def lifespan(app: FastAPI):
start_platform_fulfillment_reconciler,
stop_platform_fulfillment_reconciler,
)
from .services.task_runtime import shutdown as shutdown_task_runtime
start_integration_outbox_worker()
start_platform_fulfillment_reconciler()
start_platform_fulfillment_auto_allocator()
start_binding_poll_scheduler()
try:
yield
finally:
stop_binding_poll_scheduler()
stop_platform_fulfillment_auto_allocator()
stop_platform_fulfillment_reconciler()
stop_integration_outbox_worker()
stop_scheduler()
shutdown_task_runtime(wait=False)
app = FastAPI(