diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2011-02-19 07:40:09 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2011-02-19 07:40:09 +0000 |
| commit | 34662e7a301e651df6d8e7d978b0138c3dce76e4 (patch) | |
| tree | b6978d8bf10ef719fdad620a0d9affa55b91f1a6 | |
| parent | f58dd619b84d2afb42f035f38f5fada75b6a815b (diff) | |
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
| -rw-r--r-- | django/core/cache/backends/memcached.py | 5 |
1 files changed, 4 insertions, 1 deletions
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): """ |
