diff --git a/app/main.py b/app/main.py index 6008be4..2957a6e 100644 --- a/app/main.py +++ b/app/main.py @@ -162,7 +162,6 @@ ui.run_with( app, mount_path=settings.nicegui_mount_path, storage_secret=settings.nicegui_storage_secret, - show=False, ) diff --git a/app/services/cache.py b/app/services/cache.py index ce405ad..66ade3a 100644 --- a/app/services/cache.py +++ b/app/services/cache.py @@ -10,9 +10,9 @@ from typing import Any logger = logging.getLogger(__name__) try: - from redis.asyncio import Redis + from redis.asyncio import Redis as RedisClient except ImportError: # pragma: no cover - optional dependency - Redis = None + RedisClient = None # type: ignore[misc,assignment] class CacheService: @@ -21,8 +21,8 @@ class CacheService: def __init__(self, url: str | None, default_ttl: int = 300) -> None: self.url = url self.default_ttl = default_ttl - self._client: Redis | None = None - self._enabled = bool(url and Redis) + self._client: RedisClient | None = None + self._enabled = bool(url and RedisClient) @property def enabled(self) -> bool: @@ -30,12 +30,12 @@ class CacheService: async def connect(self) -> None: if not self._enabled: - if self.url and Redis is None: + if self.url and RedisClient is None: logger.warning("Redis URL configured but redis package is not installed; cache disabled") return try: - self._client = Redis.from_url(self.url, decode_responses=True) + self._client = RedisClient.from_url(self.url, decode_responses=True) # type: ignore[misc] await self._client.ping() logger.info("Connected to Redis cache") except Exception as exc: # pragma: no cover - network dependent diff --git a/docker-compose.yml b/docker-compose.yml index 340a785..a354855 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,7 +18,8 @@ services: UVICORN_WORKERS: 1 RUN_MIGRATIONS: 0 volumes: - - ./:/app + - ./app:/app/app + - ./config:/app/config depends_on: redis: condition: service_healthy