##// END OF EJS Templates
caches: fixed unicode error on non-ascii cache key
super-admin -
r1015:5e5c2773 default
parent child Browse files
Show More
@@ -32,7 +32,7 b' from dogpile.cache.util import memoized_'
32 from pyramid.settings import asbool
32 from pyramid.settings import asbool
33
33
34 from vcsserver.lib.memory_lru_dict import LRUDict, LRUDictDebug
34 from vcsserver.lib.memory_lru_dict import LRUDict, LRUDictDebug
35 from vcsserver.utils import safe_str
35 from vcsserver.utils import safe_str, safe_unicode
36
36
37
37
38 _default_max_size = 1024
38 _default_max_size = 1024
@@ -133,7 +133,7 b' class FileNamespaceBackend(PickleSeriali'
133 try:
133 try:
134 super(FileNamespaceBackend, self).__init__(arguments)
134 super(FileNamespaceBackend, self).__init__(arguments)
135 except Exception:
135 except Exception:
136 log.error('Failed to initialize db at: %s', db_file)
136 log.exception('Failed to initialize db at: %s', db_file)
137 raise
137 raise
138
138
139 def __repr__(self):
139 def __repr__(self):
@@ -265,7 +265,7 b' class BaseRedisBackend(redis_backend.Red'
265
265
266 def get_mutex(self, key):
266 def get_mutex(self, key):
267 if self.distributed_lock:
267 if self.distributed_lock:
268 lock_key = redis_backend.u('_lock_{0}').format(safe_str(key))
268 lock_key = redis_backend.u(u'_lock_{0}'.format(safe_unicode(key)))
269 return get_mutex_lock(self.client, lock_key, self._lock_timeout,
269 return get_mutex_lock(self.client, lock_key, self._lock_timeout,
270 auto_renewal=self._lock_auto_renewal)
270 auto_renewal=self._lock_auto_renewal)
271 else:
271 else:
General Comments 0
You need to be logged in to leave comments. Login now