Skip to content

Commit

Permalink
fix: add retries in graphql client for TransportServerError (#1594)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas1312 authored Nov 22, 2023
1 parent e8f9c0c commit f521d86
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/kili/core/graphql/graphql_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.*'
),
Expand All @@ -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),
Expand Down

0 comments on commit f521d86

Please sign in to comment.