Fix: Remove invalid 'show' param from ui.run_with(), fix mypy errors in cache.py, fix docker-compose volume mount

This commit is contained in:
Bu5hm4nn
2026-03-23 19:56:19 +01:00
parent e3b2b6213f
commit e727f216ae
3 changed files with 8 additions and 8 deletions

View File

@@ -162,7 +162,6 @@ ui.run_with(
app,
mount_path=settings.nicegui_mount_path,
storage_secret=settings.nicegui_storage_secret,
show=False,
)

View File

@@ -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

View File

@@ -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