stale calls fix
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user