Skip to content

Commit 0c79b6a

Browse files
committed
(client) wheen given, increment rate limit counter before returning response
NOTE: This doesn't seem particularly efficient? two if statements
1 parent 2bc428a commit 0c79b6a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

xbox/webapi/api/client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,15 @@ async def request(
8888
if rate_limits.is_exceeded():
8989
raise RateLimitExceededException("Rate limit exceeded", rate_limits)
9090

91-
return await self._auth_mgr.session.request(
91+
response = await self._auth_mgr.session.request(
9292
method, url, **kwargs, headers=headers, params=params, data=data
9393
)
9494

95+
if rate_limits:
96+
rate_limits.increment()
97+
98+
return response
99+
95100
async def get(self, url: str, **kwargs: Any) -> Response:
96101
return await self.request("GET", url, **kwargs)
97102

0 commit comments

Comments
 (0)