def set(self, key, value): namespace = self._namespace() key = self._key(key) value = pack(value) # PKUNK 9502 change method hset to setex self._client.setex(name='%s:%s' % (namespace, key), value=value, time=self.duration)
def set(self, key, value, ttl=None): if ttl: assert isinstance(ttl, int) namespace = self._namespace() key = self._key(key) value = pack(value) self._client.setex(name='%s:%s' % (namespace, key), value=value, time=ttl or self._ttl)
def set(self, key, value): super(SerializableMemoryCache, self).set(key, pack(value))
def set(self, key, value): namespace = self._namespace() key = self._key(key) value = pack(value) self._client.hset(namespace, key, value)