fix(bidding): create_human_task项目状态门禁——已删除/paused/archived/cancelled/completed项目不发新待办(与引擎同款,2026-09-15用户指令:暂停删除的项目不再产生待办,恢复推进后对账器按需补发)
This commit is contained in:
parent
87ecf3ee72
commit
27eb3db772
@ -371,7 +371,23 @@ async def create_human_task(sor, project_id, task_type, title, description="",
|
|||||||
同一事项只发一次待办(2026-09-01 机制层不变量):同项目+同类型已有
|
同一事项只发一次待办(2026-09-01 机制层不变量):同项目+同类型已有
|
||||||
pending 任务 → 直接返回已有 id,不重复创建。防止对账器/agent 每轮
|
pending 任务 → 直接返回已有 id,不重复创建。防止对账器/agent 每轮
|
||||||
重复发同类待办把用户淹没。
|
重复发同类待办把用户淹没。
|
||||||
|
|
||||||
|
项目状态门禁(2026-09-15,与引擎 create_human_task 同款):项目已删除或
|
||||||
|
处于 paused/archived/cancelled/completed → 不发新待办返回 ''(暂停/删除的
|
||||||
|
项目不再产生待办;恢复推进后对账器按需补发)。
|
||||||
"""
|
"""
|
||||||
|
prec = await sor.sqlExe(
|
||||||
|
"SELECT status FROM sd_projects WHERE id=${p}$", {"p": project_id or ""})
|
||||||
|
await sor.sqlExe("COMMIT", {})
|
||||||
|
if not prec:
|
||||||
|
logger.info("bid create_human_task skipped: project %s deleted (type=%s)",
|
||||||
|
project_id, task_type)
|
||||||
|
return ""
|
||||||
|
_st = getattr(prec[0], "status", "") or ""
|
||||||
|
if _st in ("paused", "archived", "cancelled", "completed"):
|
||||||
|
logger.info("bid create_human_task skipped: project %s status=%s (type=%s)",
|
||||||
|
project_id, _st, task_type)
|
||||||
|
return ""
|
||||||
exist = await find_human_task(sor, project_id, task_type, status="pending")
|
exist = await find_human_task(sor, project_id, task_type, status="pending")
|
||||||
if exist:
|
if exist:
|
||||||
logger.info("bid create_human_task dedup: type=%s existing=%s project=%s",
|
logger.info("bid create_human_task dedup: type=%s existing=%s project=%s",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user