Skip to content

Commit 1413cd7

Browse files
MattShirleyponyisi
authored andcommitted
add retries to get_transformation_results
1 parent 63669b9 commit 1413cd7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

servicex/servicex_adapter.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,12 @@ async def get_transformation_results(
304304
if later_than:
305305
params["later_than"] = later_than.isoformat()
306306

307-
async with AsyncClient() as session:
307+
retry_options = Retry(total=3, backoff_factor=10)
308+
async with AsyncClient(
309+
transport=RetryTransport(retry=retry_options), timeout=_timeout
310+
) as session:
308311
r = await session.get(headers=headers, url=url, params=params)
309-
if r.status_code == 403:
312+
if r.status_code in [401, 403]:
310313
raise AuthorizationError(
311314
f"Not authorized to access serviceX at {self.url}"
312315
)

0 commit comments

Comments
 (0)