Tool: Pyflakes Processed Files: djblets/cache/forwarding_backend.py Tool: PEP8 Style Checker Processed Files: djblets/cache/forwarding_backend.py
Add support for Django 1.7+'s caches
Review Request #8721 — Created Feb. 6, 2017 and discarded
In Django 1.7, there's a new
cachesobject which supplants the old
get_cachemethod. This change adds support for that.
Ran Review Board unit tests with log capture disabled. Saw that the
This still happens in Django 1.7+, just in a different way. Here's the relevant code from django/core/cache/__init__.py: def close_caches(**kwargs): # ...
This still happens in Django 1.7+, just in a different way. Here's the relevant code from
def close_caches(**kwargs): # Some caches -- python-memcached in particular -- need to do a cleanup at the # end of a request cycle. If not implemented in a particular backend # cache.close is a no-op for cache in caches.all(): cache.close() signals.request_finished.connect(close_caches)
So that becomes more tricky... Kinda thinking we might need to disconnect that handler and then connect our own that skips this backend (maybe by storing a flag on the forwarder saying "Ignore the close!", and set before
close_caches(), unset after).