Skip to content

Pass CACHE_OPTIONS as kwargs to redis_from_url#591

Open
foarsitter wants to merge 1 commit intopallets-eco:masterfrom
foarsitter:redis_url_cache_options
Open

Pass CACHE_OPTIONS as kwargs to redis_from_url#591
foarsitter wants to merge 1 commit intopallets-eco:masterfrom
foarsitter:redis_url_cache_options

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