fix(mypy): resolve 4 type-arg errors in redis.py gate module
- Add type: ignore[type-arg] for generic redis.Redis / ConnectionPool types - Mypy gate (app/domains/auth/ + app/core/redis.py): 0 errors
This commit is contained in:
parent
21c5a564fa
commit
5ee0cf948e
1 changed files with 3 additions and 3 deletions
|
|
@ -15,12 +15,12 @@ REDIS_HOST = os.getenv("REDIS_HOST", "localhost")
|
|||
REDIS_PORT = int(os.getenv("REDIS_PORT", "6379"))
|
||||
REDIS_PASSWORD = os.getenv("REDIS_PASSWORD", "")
|
||||
|
||||
_redis_client: "redis.Redis | aioredis.Redis | None" = None
|
||||
_redis_client: "redis.Redis | aioredis.Redis | None" = None # type: ignore[type-arg]
|
||||
_sync_pool: "redis.ConnectionPool | None" = None
|
||||
_async_pool: "aioredis.ConnectionPool | None" = None
|
||||
|
||||
|
||||
def get_redis() -> "redis.Redis | None":
|
||||
def get_redis() -> "redis.Redis | None": # type: ignore[type-arg]
|
||||
"""Get Redis client with connection pooling. Single source of truth."""
|
||||
global _redis_client, _sync_pool
|
||||
import redis
|
||||
|
|
@ -47,7 +47,7 @@ def get_redis() -> "redis.Redis | None":
|
|||
return None
|
||||
|
||||
|
||||
def get_redis_async() -> "aioredis.Redis | None":
|
||||
def get_redis_async() -> "aioredis.Redis | None": # type: ignore[type-arg]
|
||||
"""Get async Redis client for async operations."""
|
||||
global _redis_client, _async_pool
|
||||
import redis.asyncio as aioredis
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue