mirror of https://github.com/django/django.git
parent
0cb0d59b23
commit
e2013b260a
|
@ -79,6 +79,10 @@ class BaseMemcachedCache(BaseCache):
|
||||||
# make sure the key doesn't keep its old value in case of failure to set (memcached's 1MB limit)
|
# make sure the key doesn't keep its old value in case of failure to set (memcached's 1MB limit)
|
||||||
self._cache.delete(key)
|
self._cache.delete(key)
|
||||||
|
|
||||||
|
def touch(self, key, timeout=DEFAULT_TIMEOUT, version=None):
|
||||||
|
key = self.make_key(key, version=version)
|
||||||
|
return bool(self._cache.touch(key, self.get_backend_timeout(timeout)))
|
||||||
|
|
||||||
def delete(self, key, version=None):
|
def delete(self, key, version=None):
|
||||||
key = self.make_key(key, version=version)
|
key = self.make_key(key, version=version)
|
||||||
self.validate_key(key)
|
self.validate_key(key)
|
||||||
|
@ -167,10 +171,6 @@ class MemcachedCache(BaseMemcachedCache):
|
||||||
self._client = self._lib.Client(self._servers, **client_kwargs)
|
self._client = self._lib.Client(self._servers, **client_kwargs)
|
||||||
return self._client
|
return self._client
|
||||||
|
|
||||||
def touch(self, key, timeout=DEFAULT_TIMEOUT, version=None):
|
|
||||||
key = self.make_key(key, version=version)
|
|
||||||
return self._cache.touch(key, self.get_backend_timeout(timeout)) != 0
|
|
||||||
|
|
||||||
def get(self, key, default=None, version=None):
|
def get(self, key, default=None, version=None):
|
||||||
key = self.make_key(key, version=version)
|
key = self.make_key(key, version=version)
|
||||||
val = self._cache.get(key)
|
val = self._cache.get(key)
|
||||||
|
|
Loading…
Reference in New Issue