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

Cachelib class integration #556

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
10 changes: 7 additions & 3 deletions src/flask_caching/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,13 @@ def _set_cache(self, app: Flask, config) -> None:
app.extensions = {}

app.extensions.setdefault("cache", {})
app.extensions["cache"][self] = cache_factory(
app, config, cache_args, cache_options
)
if import_me.find('cachelib') > -1:
cache = cache_factory(*cache_args, **cache_options)
else:
cache = cache_factory(
app, config, cache_args, cache_options
)
app.extensions["cache"][self] = cache
self.app = app

def _call_fn(self, fn, *args, **kwargs):
Expand Down
Loading