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
caches
object which supplants the old
get_cache
method. This change adds support for that.
Ran Review Board unit tests with log capture disabled. Saw that the
RemovedInDjango19
warnings disappeared.
Description | From | Last Updated |
---|---|---|
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): # … |
chipx86 |
-
-
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): # 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).