fix(platform-fulfillment): 释放空闲连接并合并选号请求

This commit is contained in:
yml
2026-11-21 17:35:34 +08:00
parent f74573a9c0
commit 7f7943a1e8
17 changed files with 690 additions and 74 deletions
+8 -2
View File
@@ -352,15 +352,21 @@ def allocate_task(
db: Session = Depends(get_db),
current: User = Depends(require_permission("platform_fulfillment:use")),
) -> dict[str, Any]:
result = service.allocate_task(db, task_id=task_id, current=current)
result = service.prepare_manual_allocation(db, task_id=task_id, current=current)
record_audit(
db,
current,
action="platform_fulfillment:allocate",
target=f"platform_fulfillment_task:{task_id}",
detail={"accountId": result.get("task", {}).get("account", {})},
detail={"requested": True},
)
db.commit()
from ..services.platform_fulfillment.auto_allocator import queue_task_allocation
result["allocationQueued"] = (
result.get("task", {}).get("executionStatus") == "ready"
and queue_task_allocation(task_id)
)
return result