Show More
@@ -24,6 +24,7 b' import logging' | |||
|
24 | 24 | |
|
25 | 25 | import msgpack |
|
26 | 26 | import gevent |
|
27 | import redis | |
|
27 | 28 | |
|
28 | 29 | from dogpile.cache.api import CachedValue |
|
29 | 30 | from dogpile.cache.backends import memory as memory_backend |
@@ -203,6 +204,23 b' class FileNamespaceBackend(PickleSeriali' | |||
|
203 | 204 | |
|
204 | 205 | |
|
205 | 206 | class BaseRedisBackend(redis_backend.RedisBackend): |
|
207 | ||
|
208 | def _create_client(self): | |
|
209 | args = {} | |
|
210 | ||
|
211 | if self.url is not None: | |
|
212 | args.update(url=self.url) | |
|
213 | ||
|
214 | else: | |
|
215 | args.update( | |
|
216 | host=self.host, password=self.password, | |
|
217 | port=self.port, db=self.db | |
|
218 | ) | |
|
219 | ||
|
220 | connection_pool = redis.ConnectionPool(**args) | |
|
221 | ||
|
222 | return redis.StrictRedis(connection_pool=connection_pool) | |
|
223 | ||
|
206 | 224 | def list_keys(self, prefix=''): |
|
207 | 225 | prefix = '{}:{}*'.format(self.key_prefix, prefix) |
|
208 | 226 | return self.client.keys(prefix) |
General Comments 0
You need to be logged in to leave comments.
Login now