diff options
author | 2024-10-09 20:06:04 +0200 | |
---|---|---|
committer | 2024-11-23 19:16:23 +0000 | |
commit | 9dc2aeab0e57743332e212d4fb3907e3da52dd3d (patch) | |
tree | 57c08db23a52b96bf1447ce4ac63720b66fe2428 | |
parent | Branding: do not invoke calendar after refresh (diff) |
Branding: improve decorator name
-rw-r--r-- | bot/exts/backend/branding/_repository.py | 6 |
1 files 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`. |