From f521d862e7c7b0138227ea981e77bfd028cbcd14 Mon Sep 17 00:00:00 2001 From: Jonas Maison Date: Wed, 22 Nov 2023 13:00:17 +0100 Subject: [PATCH] fix: add retries in graphql client for TransportServerError (#1594) --- src/kili/core/graphql/graphql_client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/kili/core/graphql/graphql_client.py b/src/kili/core/graphql/graphql_client.py index 545329975..ab502da9b 100644 --- a/src/kili/core/graphql/graphql_client.py +++ b/src/kili/core/graphql/graphql_client.py @@ -276,7 +276,9 @@ def execute( @retry( reraise=True, # re-raise the last exception retry=retry_all( - retry_if_exception_type(exceptions.TransportQueryError), # error received from server + retry_if_exception_type( # error received from server + (exceptions.TransportQueryError, exceptions.TransportServerError) + ), retry_if_not_exception_message( match=r'.*Variable "(\$\w+)" of required type "(\w+!)" was not provided.*' ), @@ -287,6 +289,7 @@ def execute( retry_any( retry_if_exception_message(match=r".*Invalid request made to Flagsmith API.*"), retry_if_exception_message(match=r".*Failed to fetch data connection.*"), + retry_if_exception_message(match=r".*Unauthorized for url.*"), ), ), stop=stop_after_delay(3 * 60),