Skip to content

Commit

Permalink
Pass CACHE_OPTIONS as kwargs to redis_from_url
Browse files Browse the repository at this point in the history
  • Loading branch information
foarsitter committed Oct 11, 2024
1 parent 494d498 commit 3078a2e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/flask_caching/backends/rediscache.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def factory(cls, app, config, args, kwargs):

redis_url = config.get("CACHE_REDIS_URL")
if redis_url:
kwargs["host"] = redis_from_url(redis_url, db=kwargs.pop("db", None))
redis_kwargs = config.pop("CACHE_OPTIONS", None) or {}
kwargs["host"] = redis_from_url(redis_url, db=kwargs.pop("db", None), **redis_kwargs)

new_class = cls(*args, **kwargs)

Expand Down

0 comments on commit 3078a2e

Please sign in to comment.