summaryrefslogtreecommitdiff
path: root/django/core/cache
diff options
context:
space:
mode:
Diffstat (limited to 'django/core/cache')
-rw-r--r--django/core/cache/backends/memcached.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/django/core/cache/backends/memcached.py b/django/core/cache/backends/memcached.py
index 19671b4872..4cf25fb4c6 100644
--- a/django/core/cache/backends/memcached.py
+++ b/django/core/cache/backends/memcached.py
@@ -103,6 +103,7 @@ class BaseMemcachedCache(BaseCache):
return ret
def close(self, **kwargs):
+ # Many clients don't clean up connections properly.
self._cache.disconnect_all()
def incr(self, key, delta=1, version=None):
@@ -202,3 +203,8 @@ class PyLibMCCache(BaseMemcachedCache):
@cached_property
def _cache(self):
return self._lib.Client(self._servers, **self._options)
+
+ def close(self, **kwargs):
+ # libmemcached manages its own connections. Don't call disconnect_all()
+ # as it resets the failover state and creates unnecessary reconnects.
+ pass