##// END OF EJS Templates
Fixed problems with unicode cache keys in celery
marcink -
r1641:cd1c21af default
parent child Browse files
Show More
@@ -195,6 +195,9 b" def safe_str(unicode_, to_encoding='utf8"
195 :rtype: str
195 :rtype: str
196 :returns: str object
196 :returns: str object
197 """
197 """
198
199 if not isinstance(unicode_, basestring):
200 return str(unicode_)
198
201
199 if isinstance(unicode_, str):
202 if isinstance(unicode_, str):
200 return unicode_
203 return unicode_
@@ -36,7 +36,7 b' from pylons import config'
36
36
37 from vcs.utils.lazy import LazyProperty
37 from vcs.utils.lazy import LazyProperty
38
38
39 from rhodecode.lib import str2bool
39 from rhodecode.lib import str2bool, safe_str
40 from rhodecode.lib.pidlock import DaemonLock, LockHeld
40 from rhodecode.lib.pidlock import DaemonLock, LockHeld
41
41
42 from celery.messaging import establish_connection
42 from celery.messaging import establish_connection
@@ -87,7 +87,7 b' def __get_lockkey(func, *fargs, **fkwarg'
87 func_name = str(func.__name__) if hasattr(func, '__name__') else str(func)
87 func_name = str(func.__name__) if hasattr(func, '__name__') else str(func)
88
88
89 lockkey = 'task_%s.lock' % \
89 lockkey = 'task_%s.lock' % \
90 md5(func_name + '-' + '-'.join(map(str, params))).hexdigest()
90 md5(func_name + '-' + '-'.join(map(safe_str, params))).hexdigest()
91 return lockkey
91 return lockkey
92
92
93
93
General Comments 0
You need to be logged in to leave comments. Login now