mirror of
https://github.com/Kludex/awesome-fastapi-projects.git
synced 2025-05-16 14:16:35 +00:00
Add ReadTimeout for errors to retry for in SourceGraph client
This commit is contained in:
parent
ffc62be92a
commit
1ec3c0d57f
@ -90,7 +90,9 @@ class AsyncSourceGraphSSEClient:
|
||||
self: Self, **kwargs: MutableMapping[str, Any]
|
||||
) -> AsyncGenerator[ServerSentEvent, None]:
|
||||
"""Iterate over the SourceGraph SSE API with retries."""
|
||||
async for attempt in stamina.retry_context(on=httpx.ReadError):
|
||||
async for attempt in stamina.retry_context(
|
||||
on=(httpx.ReadError, httpx.ReadTimeout)
|
||||
):
|
||||
with attempt:
|
||||
await asyncio.sleep(self._reconnection_delay)
|
||||
async for event in self._aiter_sse(**kwargs):
|
||||
|
Loading…
x
Reference in New Issue
Block a user