perf(fulfillment): Webhook 新订单即时选号

This commit is contained in:
yml
2026-11-23 14:09:04 +08:00
parent 05a7a56c4e
commit 11c2a0dba7
4 changed files with 123 additions and 12 deletions
+7 -3
View File
@@ -99,10 +99,14 @@ def sync_tasks(
current: User = Depends(require_permission("platform_fulfillment:use")),
) -> dict[str, Any]:
result = service.sync_pending_tasks(db, limit=limit)
if result.get("taskIds"):
from ..services.platform_fulfillment.auto_allocator import wake_auto_allocator
from ..services.platform_fulfillment.auto_allocator import (
run_immediate_allocation,
)
wake_auto_allocator(result["taskIds"])
result["immediateAllocation"] = run_immediate_allocation(
db,
task_ids=result.get("taskIds", []),
)
record_audit(
db,
current,