mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
address greptile review feedback (greploop iteration 6)
- Exclude expired tasks from claim_due return value to prevent agents from receiving expired task payloads Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
de849bff75
commit
98aa9dc84f
1 changed files with 3 additions and 0 deletions
|
|
@ -326,6 +326,7 @@ async def claim_due(
|
|||
if not rows:
|
||||
return []
|
||||
|
||||
expired_task_ids: set = set()
|
||||
async with tx.batch_() as batcher:
|
||||
for r in rows:
|
||||
expires_at = r["expires_at"]
|
||||
|
|
@ -339,6 +340,7 @@ async def claim_due(
|
|||
if expires_at <= now:
|
||||
new_status = "expired"
|
||||
new_next = r["next_run_at"]
|
||||
expired_task_ids.add(r["task_id"])
|
||||
elif r["fire_once"]:
|
||||
new_status = "fired"
|
||||
new_next = r["next_run_at"]
|
||||
|
|
@ -371,4 +373,5 @@ async def claim_due(
|
|||
"scheduled_for": r["next_run_at"],
|
||||
}
|
||||
for r in rows
|
||||
if r["task_id"] not in expired_task_ids
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue