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:
parent
ac3f888853
commit
7b4b364beb
1 changed files with 3 additions and 2 deletions
|
@ -174,8 +174,6 @@ class HTTPClient:
|
||||||
async with self.__session.request(
|
async with self.__session.request(
|
||||||
method, f"https://api.github.com{path}", **kwargs
|
method, f"https://api.github.com{path}", **kwargs
|
||||||
) as request:
|
) as request:
|
||||||
if 200 <= request.status <= 299:
|
|
||||||
return await request.json()
|
|
||||||
|
|
||||||
headers = request.headers
|
headers = request.headers
|
||||||
|
|
||||||
|
@ -189,6 +187,9 @@ class HTTPClient:
|
||||||
datetime.now(timezone.utc),
|
datetime.now(timezone.utc),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if 200 <= request.status <= 299:
|
||||||
|
return await request.json()
|
||||||
|
|
||||||
raise error_from_request(request)
|
raise error_from_request(request)
|
||||||
|
|
||||||
# === ROUTES === #
|
# === ROUTES === #
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue