Skip to content

Commit 9dc2aea

Browse files
kwzrdChrisLovering
authored andcommitted
Branding: improve decorator name
1 parent 428f702 commit 9dc2aea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bot/exts/backend/branding/_repository.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def _raise_for_status(resp: ClientResponse) -> None:
9494
raise
9595

9696

97-
_retry_fetch = retry(
97+
_retry_server_error = retry(
9898
retry=retry_if_exception_type(GitHubServerError), # Only retry this error.
9999
stop=stop_after_attempt(5), # Up to 5 attempts.
100100
wait=wait_exponential(), # Exponential backoff: 1, 2, 4, 8 seconds.
@@ -124,7 +124,7 @@ class BrandingRepository:
124124
def __init__(self, bot: Bot) -> None:
125125
self.bot = bot
126126

127-
@_retry_fetch
127+
@_retry_server_error
128128
async def fetch_directory(self, path: str, types: t.Container[str] = ("file", "dir")) -> dict[str, RemoteObject]:
129129
"""
130130
Fetch directory found at `path` in the branding repository.
@@ -142,7 +142,7 @@ async def fetch_directory(self, path: str, types: t.Container[str] = ("file", "d
142142

143143
return {file["name"]: RemoteObject(file) for file in json_directory if file["type"] in types}
144144

145-
@_retry_fetch
145+
@_retry_server_error
146146
async def fetch_file(self, download_url: str) -> bytes:
147147
"""
148148
Fetch file as bytes from `download_url`.

0 commit comments

Comments
 (0)