Skip to content

Commit 4a291c5

Browse files
committed
feat: Add debug logging for retry mechanism in DiscordAnalytics API calls
1 parent f475dcc commit 4a291c5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

discordanalytics/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ async def api_call_with_retries(self, method, url, headers, json, max_retries=5,
9393
raise ValueError(ErrorCodes.INVALID_RESPONSE)
9494
except (aiohttp.ClientError, ValueError) as e:
9595
retries += 1
96+
if self.debug:
97+
print(f"[DISCORDANALYTICS] Error: {e}. Retrying in {backoff_factor * (2 ** retries)} seconds...")
9698
if retries >= max_retries:
9799
raise e
98100
await asyncio.sleep(backoff_factor * (2 ** retries))

0 commit comments

Comments
 (0)