From 9dc2aeab0e57743332e212d4fb3907e3da52dd3d Mon Sep 17 00:00:00 2001 From: kwzrd Date: Wed, 9 Oct 2024 20:06:04 +0200 Subject: Branding: improve decorator name --- bot/exts/backend/branding/_repository.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/exts/backend/branding/_repository.py b/bot/exts/backend/branding/_repository.py index 455a434e0..d661cd7a8 100644 --- a/bot/exts/backend/branding/_repository.py +++ b/bot/exts/backend/branding/_repository.py @@ -94,7 +94,7 @@ def _raise_for_status(resp: ClientResponse) -> None: raise -_retry_fetch = retry( +_retry_server_error = retry( retry=retry_if_exception_type(GitHubServerError), # Only retry this error. stop=stop_after_attempt(5), # Up to 5 attempts. wait=wait_exponential(), # Exponential backoff: 1, 2, 4, 8 seconds. @@ -124,7 +124,7 @@ class BrandingRepository: def __init__(self, bot: Bot) -> None: self.bot = bot - @_retry_fetch + @_retry_server_error async def fetch_directory(self, path: str, types: t.Container[str] = ("file", "dir")) -> dict[str, RemoteObject]: """ Fetch directory found at `path` in the branding repository. @@ -142,7 +142,7 @@ class BrandingRepository: return {file["name"]: RemoteObject(file) for file in json_directory if file["type"] in types} - @_retry_fetch + @_retry_server_error async def fetch_file(self, download_url: str) -> bytes: """ Fetch file as bytes from `download_url`. -- cgit v1.2.3