Фикс рейт лимита
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "aiohttpx"
|
name = "aiohttpx"
|
||||||
version = "1.2.0"
|
version = "1.2.1"
|
||||||
description = "Custom HTTPX client with aiohttp transport, rate limiter and caching"
|
description = "Custom HTTPX client with aiohttp transport, rate limiter and caching"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
authors = [
|
authors = [
|
||||||
|
|||||||
@ -27,7 +27,8 @@ class AsyncRateLimit(AiohttpTransport):
|
|||||||
|
|
||||||
async def request_is_limited(self) -> bool:
|
async def request_is_limited(self) -> bool:
|
||||||
if self.client and self.key and self.limit:
|
if self.client and self.key and self.limit:
|
||||||
t: int = int(self.client.time()[0]) # type: ignore
|
time = await self.client.time() # type: ignore
|
||||||
|
t: int = int(time[0]) # type: ignore
|
||||||
separation = round(60 / self.limit)
|
separation = round(60 / self.limit)
|
||||||
|
|
||||||
value = await self.client.get(self.key) or t
|
value = await self.client.get(self.key) or t
|
||||||
|
|||||||
Reference in New Issue
Block a user