summaryrefslogtreecommitdiff
path: root/django/core/cache/backends/memcached.py
diff options
context:
space:
mode:
authorEd Morley <emorley@mozilla.com>2016-09-02 09:33:59 +0100
committerTim Graham <timograham@gmail.com>2016-09-02 14:44:27 -0400
commitf02dbbe1ae02c3258fced7b7a75d35d7745cc02a (patch)
tree9a97b92b12e2e4a22fa098469e98b93f407f93d2 /django/core/cache/backends/memcached.py
parent3e935aec6d6c670b3e48425d60ec94fc96f5cdd6 (diff)
Fixed #11331 -- Stopped closing pylibmc connections after each request.
libmemcached manages its own connections, so isn't affected by refs #5133.
Diffstat (limited to 'django/core/cache/backends/memcached.py')
-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