mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
address greptile review feedback (greploop iteration 6 followup)
- Gate all report_task_result error-path writes on status=pending to prevent late error reports from mutating terminal-state tasks Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
98aa9dc84f
commit
ca0eae194c
1 changed files with 5 additions and 6 deletions
|
|
@ -189,15 +189,14 @@ async def report_task_result(
|
|||
"consecutive_errors": new_count,
|
||||
"last_error": reason,
|
||||
}
|
||||
where_clause: Dict[str, Any] = {
|
||||
"task_id": task_id,
|
||||
"owner_token": owner_token,
|
||||
}
|
||||
if new_count >= MAX_CONSECUTIVE_ERRORS:
|
||||
update_data["status"] = "failed"
|
||||
where_clause["status"] = "pending"
|
||||
affected = await prisma_client.db.litellm_scheduledtasktable.update_many(
|
||||
where=where_clause,
|
||||
where={
|
||||
"task_id": task_id,
|
||||
"owner_token": owner_token,
|
||||
"status": "pending",
|
||||
},
|
||||
data=update_data,
|
||||
)
|
||||
if affected == 0:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue