Skip to content

Commit d55062b

Browse files
committed
Use BaseMemcachedCache as base class
1 parent 6728c13 commit d55062b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

django_elasticache/memcached.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import socket
55
from functools import wraps
66
from django.core.cache import InvalidCacheBackendError
7-
from django.core.cache.backends.memcached import PyLibMCCache
7+
from django.core.cache.backends.memcached import BaseMemcachedCache
88
from threading import local
99
from .cluster_utils import get_cluster_info
1010

@@ -23,15 +23,16 @@ def wrapper(self, *args, **kwds):
2323
return wrapper
2424

2525

26-
class ElastiCache(PyLibMCCache):
26+
class ElastiCache(BaseMemcachedCache):
2727
"""
2828
backend for Amazon ElastiCache (memcached) with auto discovery mode
2929
it used pylibmc in binary mode
3030
"""
3131
def __init__(self, server, params):
3232
self._local = local()
3333
self.update_params(params)
34-
super(ElastiCache, self).__init__(server, params)
34+
import pylibmc
35+
super(ElastiCache, self).__init__(server, params, library=pylibmc, value_not_found_exception=pylibmc.NotFound)
3536
if len(self._servers) > 1:
3637
raise InvalidCacheBackendError(
3738
'ElastiCache should be configured with only one server '

0 commit comments

Comments
 (0)