From deb5555d6823947662498e062d5d536a27440324 Mon Sep 17 00:00:00 2001 From: Matt Shirley Date: Tue, 5 Aug 2025 12:07:24 -0500 Subject: [PATCH] add retries to get_transformation_results --- servicex/servicex_adapter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/servicex/servicex_adapter.py b/servicex/servicex_adapter.py index 5625fae6..30832cce 100644 --- a/servicex/servicex_adapter.py +++ b/servicex/servicex_adapter.py @@ -304,9 +304,12 @@ async def get_transformation_results( if later_than: params["later_than"] = later_than.isoformat() - async with AsyncClient() as session: + retry_options = Retry(total=3, backoff_factor=10) + async with AsyncClient( + transport=RetryTransport(retry=retry_options), timeout=_timeout + ) as session: r = await session.get(headers=headers, url=url, params=params) - if r.status_code == 403: + if r.status_code in [401, 403]: raise AuthorizationError( f"Not authorized to access serviceX at {self.url}" )