Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass CACHE_OPTIONS as kwargs to redis_from_url #591

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

foarsitter
Copy link

This PR passes CACHE_OPTIONS as **kwargs to redis_from_url so complex option be can passed to redis client.

cache = Cache(
    config={
        "CACHE_TYPE": os.environ.get("CACHE_TYPE", "RedisCache"),
        "CACHE_REDIS_URL": redis_cache_url(),
        "CACHE_OPTIONS": {
            "retry": Retry(ExponentialBackoff(cap=2, base=1), 3),
            "retry_on_error": [ConnectionError, TimeoutError, ConnectionRefusedError, ConnectionResetError],
            "health_check_interval": 1,
        },
    }
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

CACHE_OPTIONS has no effect if CACHE_REDIS_URL is set
1 participant