stale calls fix

This commit is contained in:
Logan
2026-06-22 00:06:10 -04:00
parent 1f17b6c0d2
commit 3defdf18dc
2 changed files with 97 additions and 6 deletions
+7 -4
View File
@@ -78,10 +78,13 @@ async def close_stale_calls(
started_raw = call.get("started_at")
if not started_raw:
continue
try:
started = datetime.fromisoformat(started_raw.replace("Z", "+00:00"))
except Exception:
continue
if isinstance(started_raw, datetime):
started = started_raw if started_raw.tzinfo else started_raw.replace(tzinfo=timezone.utc)
else:
try:
started = datetime.fromisoformat(str(started_raw).replace("Z", "+00:00"))
except Exception:
continue
if started < cutoff:
stale.append(call)