16 lines
429 B
Python
16 lines
429 B
Python
import redis.asyncio as redis
|
|
from redis.asyncio.client import Redis
|
|
from src.infrastructure.config import settings
|
|
|
|
|
|
def create_redis_client() -> Redis:
|
|
return redis.from_url(
|
|
settings.REDIS_URL,
|
|
max_connections=50,
|
|
decode_responses=True,
|
|
socket_timeout=5,
|
|
socket_connect_timeout=5,
|
|
health_check_interval=30,
|
|
retry_on_timeout=True,
|
|
socket_keepalive=True,
|
|
) |