18 lines
390 B
Python
18 lines
390 B
Python
from __future__ import annotations
|
|
|
|
import redis
|
|
|
|
from app.core.config import settings
|
|
|
|
|
|
def get_redis() -> redis.Redis:
|
|
return redis.Redis(
|
|
host=settings.redis_host,
|
|
port=settings.redis_port,
|
|
password=settings.redis_password or None,
|
|
db=settings.redis_db,
|
|
decode_responses=True,
|
|
socket_connect_timeout=5,
|
|
socket_timeout=5,
|
|
)
|