load redis and mqtt only from env
All checks were successful
ci/woodpecker/push/build/4 Pipeline was successful
ci/woodpecker/push/build/2 Pipeline was successful
ci/woodpecker/push/predeploy Pipeline was successful
ci/woodpecker/push/deploy/1 Pipeline was successful
ci/woodpecker/push/deploy/2 Pipeline was successful
ci/woodpecker/tag/predeploy Pipeline was successful
ci/woodpecker/push/build/3 Pipeline was successful
ci/woodpecker/push/build/1 Pipeline was successful
ci/woodpecker/push/deploy/4 Pipeline was successful
ci/woodpecker/push/deploy/3 Pipeline was successful
ci/woodpecker/tag/build/1 Pipeline was successful
ci/woodpecker/tag/build/4 Pipeline was successful
ci/woodpecker/tag/build/2 Pipeline was successful
ci/woodpecker/tag/build/3 Pipeline was successful
ci/woodpecker/tag/deploy/4 Pipeline was successful
ci/woodpecker/tag/deploy/2 Pipeline was successful
ci/woodpecker/tag/deploy/3 Pipeline was successful
ci/woodpecker/tag/deploy/1 Pipeline was successful
All checks were successful
ci/woodpecker/push/build/4 Pipeline was successful
ci/woodpecker/push/build/2 Pipeline was successful
ci/woodpecker/push/predeploy Pipeline was successful
ci/woodpecker/push/deploy/1 Pipeline was successful
ci/woodpecker/push/deploy/2 Pipeline was successful
ci/woodpecker/tag/predeploy Pipeline was successful
ci/woodpecker/push/build/3 Pipeline was successful
ci/woodpecker/push/build/1 Pipeline was successful
ci/woodpecker/push/deploy/4 Pipeline was successful
ci/woodpecker/push/deploy/3 Pipeline was successful
ci/woodpecker/tag/build/1 Pipeline was successful
ci/woodpecker/tag/build/4 Pipeline was successful
ci/woodpecker/tag/build/2 Pipeline was successful
ci/woodpecker/tag/build/3 Pipeline was successful
ci/woodpecker/tag/deploy/4 Pipeline was successful
ci/woodpecker/tag/deploy/2 Pipeline was successful
ci/woodpecker/tag/deploy/3 Pipeline was successful
ci/woodpecker/tag/deploy/1 Pipeline was successful
This commit is contained in:
@@ -391,9 +391,19 @@ async def async_main() -> None:
|
||||
validate_devices(devices)
|
||||
logger.info(f"Loaded {len(devices)} device(s) from configuration")
|
||||
|
||||
# Get Redis URL from config or environment variable or use default
|
||||
redis_config = config.get("redis", {})
|
||||
redis_url = redis_config.get("url") or os.environ.get("REDIS_URL", "redis://localhost:6379/0")
|
||||
# Build Redis URL from environment variables or config or use default
|
||||
redis_host = os.environ.get("REDIS_HOST")
|
||||
redis_port = os.environ.get("REDIS_PORT")
|
||||
redis_db = os.environ.get("REDIS_DB")
|
||||
|
||||
if redis_host and redis_port and redis_db:
|
||||
redis_url = f"redis://{redis_host}:{redis_port}/{redis_db}"
|
||||
logger.info(f"Using Redis from environment variables: {redis_url}")
|
||||
else:
|
||||
# Fallback to config file
|
||||
redis_config = config.get("redis", {})
|
||||
redis_url = redis_config.get("url") or "redis://localhost:6379/0"
|
||||
logger.info(f"Using Redis from config file: {redis_url}")
|
||||
|
||||
# Connect to Redis with retry
|
||||
redis_client = await get_redis_client(redis_url)
|
||||
|
||||
Reference in New Issue
Block a user