fix: COMMIT after claim_task to release row lock before LLM call
This commit is contained in:
parent
eb889d8694
commit
3b1718783a
@ -409,6 +409,12 @@ async def role_agent_run(project_id, role, agent_id=None, model_name=None):
|
||||
params_str = getattr(task, "params", "{}") or "{}"
|
||||
workspace_dir = await _get_workspace_dir(sor, project_id)
|
||||
|
||||
# 提交 claim 事务,释放行锁
|
||||
try:
|
||||
await sor.sqlExe("COMMIT", {})
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# 确保 repos 目录存在
|
||||
repos_dir = os.path.join(workspace_dir, 'repos')
|
||||
if not os.path.isdir(repos_dir):
|
||||
@ -530,6 +536,12 @@ async def pm_review_run(project_id, agent_id=None, model_name=None):
|
||||
task_role = _normalize_role(getattr(task, "role", "") or "")
|
||||
workspace_dir = await _get_workspace_dir(sor, project_id)
|
||||
|
||||
# 提交 claim 事务,释放行锁,避免后续长操作(LLM调用)阻塞其他写入
|
||||
try:
|
||||
await sor.sqlExe("COMMIT", {})
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# 首次审核时,确保仓库已 clone
|
||||
repos = await _get_project_repos(sor, project_id)
|
||||
if repos:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user