From 34662e7a301e651df6d8e7d978b0138c3dce76e4 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sat, 19 Feb 2011 07:40:09 +0000 Subject: [PATCH] Fixed #15324 -- Modified the connection creation code for the memcache cache backend. Thanks to dlowe for the report and initial patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15567 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/cache/backends/memcached.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/django/core/cache/backends/memcached.py b/django/core/cache/backends/memcached.py index 97d4317dec..a40416d90d 100644 --- a/django/core/cache/backends/memcached.py +++ b/django/core/cache/backends/memcached.py @@ -28,7 +28,10 @@ class BaseMemcachedCache(BaseCache): """ Implements transparent thread-safe access to a memcached client. """ - return self._lib.Client(self._servers) + if getattr(self, '_client', None) is None: + self._client = self._lib.Client(self._servers) + + return self._client def _get_memcache_timeout(self, timeout): """