1
Fork 0
mirror of https://github.com/RGBCube/GitHubWrapper synced 2025-05-29 12:15:12 +00:00

Fix ratelimits not getting updated when the request is successful

This commit is contained in:
RGBCube 2022-06-27 13:16:44 +03:00
parent ac3f888853
commit 7b4b364beb

View file

@ -174,8 +174,6 @@ class HTTPClient:
async with self.__session.request(
method, f"https://api.github.com{path}", **kwargs
) as request:
if 200 <= request.status <= 299:
return await request.json()
headers = request.headers
@ -189,6 +187,9 @@ class HTTPClient:
datetime.now(timezone.utc),
)
if 200 <= request.status <= 299:
return await request.json()
raise error_from_request(request)
# === ROUTES === #