fix(platform-fulfillment): 释放空闲连接并合并选号请求
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user