INNER CODE UNIT · Python

_warn_refusal_once

redis/fastapi-redis-sdk · src/redis_fastapi/cache.py:517

def _warn_refusal_once(request: Request, reason: str) -> None:
    """Log why a response was not stored, once per route and reason.

    Args:
        request: The request whose response was refused.
        reason: The refusal reason from :func:`_storage_refusal`.
    """
    marker = (_route_label(request), reason)
    if marker in _WARNED_REFUSALS:
        return
    _WARNED_REFUSALS.add(marker)
    logger.warning(
        "%s was served but not cached: %s.  cache() stores serializable text "
        "representations only; see 'Cache scope' in the architecture guide.",
        marker[0],
        reason,
    )

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…