Skip to content

Commit fd67def

Browse files
committed
add client sync changes
1 parent 99780fc commit fd67def

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

infrahub_sdk/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1618,7 +1618,8 @@ def execute_graphql(
16181618

16191619
retry = True
16201620
resp = None
1621-
while retry:
1621+
start_time = time.time()
1622+
while retry and time.time() - start_time < self.config.max_retry_duration:
16221623
retry = self.retry_on_failure
16231624
try:
16241625
resp = self._post(url=url, payload=payload, headers=headers, timeout=timeout)
@@ -1642,6 +1643,8 @@ def execute_graphql(
16421643
errors = response.get("errors", [])
16431644
messages = [error.get("message") for error in errors]
16441645
raise AuthenticationError(" | ".join(messages)) from exc
1646+
if exc.response.status_code == 404:
1647+
raise URLNotFoundError(url=url)
16451648

16461649
if not resp:
16471650
raise Error("Unexpected situation, resp hasn't been initialized.")

0 commit comments

Comments
 (0)