|
Cat Feeder
1.0.0
The Cat feeder project
|
Data Structures | |
| class | RedisArgs |
Functions | |
| RedisArgs | build_redis_args () |
# +==== BEGIN CatFeeder =================+ # LOGO: # ..............(..../\ # ...............)..(.') # ..............(../..) # ...............\(__)| # Inspired by Joan Stark # source https://www.asciiart.eu/ # animals/cats # /STOP # PROJECT: CatFeeder # FILE: redis_args.py # CREATION DATE: 15-11-2025 # LAST Modified: 14:51:26 19-12-2025 # DESCRIPTION: # This is the backend server in charge of making the actual website work. # /STOP # COPYRIGHT: (c) Cat Feeder # PURPOSE: This is the file that will contain the dataclass with the optional redis initialisation information. # // AR # +==== END CatFeeder =================+
| RedisArgs backend.src.libs.redis.redis_args.build_redis_args | ( | ) |
Create and return a configured Redis client.
This function does not connect immediately; the client will establish
a connection upon first command execution.
Connection Priority:
1. Unix socket (if REDIS_SOCKET is set and file exists) - preferred for docker-compose
2. TCP connection (REDIS_HOST:REDIS_PORT) - fallback for CI/testing environments
Environment Variables:
- REDIS_SOCKET: Path to Unix socket (default: /run/redis/redis.sock)
- REDIS_HOST: Redis host for TCP connection (default: 127.0.0.1)
- REDIS_PORT: Redis port for TCP connection (default: 6379)
- REDIS_PASSWORD: Redis password (required)
Returns:
redis.Redis: Configured Redis client instance.
Definition at line 110 of file redis_args.py.