Skip to content

Commit 6728c13

Browse files
committed
Store client in thread safe way
1 parent 5f93c06 commit 6728c13

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

django_elasticache/memcached.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from functools import wraps
66
from django.core.cache import InvalidCacheBackendError
77
from django.core.cache.backends.memcached import PyLibMCCache
8+
from threading import local
89
from .cluster_utils import get_cluster_info
910

1011

@@ -28,6 +29,7 @@ class ElastiCache(PyLibMCCache):
2829
it used pylibmc in binary mode
2930
"""
3031
def __init__(self, server, params):
32+
self._local = local()
3133
self.update_params(params)
3234
super(ElastiCache, self).__init__(server, params)
3335
if len(self._servers) > 1:

0 commit comments

Comments
 (0)