fix: cleanup cache logs

This commit is contained in:
Rajat Ahuja 2025-11-21 15:50:37 -05:00
parent 4ee2f8bd0c
commit 414964dc4e
3 changed files with 6 additions and 2 deletions

View File

@ -216,7 +216,7 @@ Honcho supports Redis caching to improve performance by caching frequently acces
CACHE_ENABLED=false # Set to true to enable caching
# Redis connection
CACHE_URL=redis://localhost:6379/0?suppress=false
CACHE_URL=redis://localhost:6379/0?suppress=true
# Cache namespace and TTL
CACHE_NAMESPACE=honcho # Prefix for all cache keys

View File

@ -330,7 +330,7 @@ class CacheSettings(HonchoSettings):
model_config = SettingsConfigDict(env_prefix="CACHE_", extra="ignore") # pyright: ignore
ENABLED: bool = False
URL: str = "redis://localhost:6379/0?suppress=false"
URL: str = "redis://localhost:6379/0?suppress=true"
NAMESPACE: str | None = None
DEFAULT_TTL_SECONDS: Annotated[int, Field(default=300, ge=1, le=86_400)] = (
300 # how long to keep items in cache

View File

@ -64,6 +64,10 @@ logging.basicConfig(
)
logger = logging.getLogger(__name__)
# Suppress cashews Redis error logs (NoScriptError, ConnectionError, etc.)
# These are handled gracefully by SafeRedis and don't need full tracebacks
logging.getLogger("cashews.backends.redis.client").setLevel(logging.CRITICAL)
# JWT Setup
async def setup_admin_jwt():