Фикс типизации
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "aiohttpx"
|
||||
version = "1.2.1"
|
||||
version = "1.2.2"
|
||||
description = "Custom HTTPX client with aiohttp transport, rate limiter and caching"
|
||||
readme = "README.md"
|
||||
authors = [
|
||||
|
||||
@ -17,7 +17,7 @@ def generate_cache_key(request: Request) -> str:
|
||||
|
||||
|
||||
async def cache_response(
|
||||
client: Redis[bytes],
|
||||
client: 'Redis[bytes]',
|
||||
cache_key: str,
|
||||
request: Request,
|
||||
response: Response | HTTPXResponse,
|
||||
@ -38,7 +38,7 @@ def get_ttl_from_headers(headers: m.Headers) -> int | None:
|
||||
|
||||
|
||||
async def get_cached_response(
|
||||
client: Redis[bytes], cache_key: str
|
||||
client: 'Redis[bytes]', cache_key: str
|
||||
) -> Response | None:
|
||||
cached_data = await client.get(cache_key)
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ from aiohttpx.transports.aio import AiohttpTransport
|
||||
|
||||
class AsyncRateLimit(AiohttpTransport):
|
||||
def __init__(
|
||||
self, redis: Redis[bytes] | None, key: str | None, limit: int | None
|
||||
self, redis: 'Redis[bytes] | None', key: str | None, limit: int | None
|
||||
) -> None:
|
||||
self.transport = AiohttpTransport()
|
||||
self.client = redis
|
||||
|
||||
Reference in New Issue
Block a user