Mercurial > kallithea
changeset 1611:2755c11c90d8 beta
Fixed problems with unicode cache keys in celery
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 29 Oct 2011 17:44:46 +0200 |
parents | 277690a23606 |
children | 5cb398de935e d58e514c0a39 |
files | rhodecode/lib/__init__.py rhodecode/lib/celerylib/__init__.py |
diffstat | 2 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/lib/__init__.py Sat Oct 29 02:54:27 2011 +0200 +++ b/rhodecode/lib/__init__.py Sat Oct 29 17:44:46 2011 +0200 @@ -223,6 +223,9 @@ :rtype: str :returns: str object """ + + if not isinstance(unicode_, basestring): + return str(unicode_) if isinstance(unicode_, str): return unicode_
--- a/rhodecode/lib/celerylib/__init__.py Sat Oct 29 02:54:27 2011 +0200 +++ b/rhodecode/lib/celerylib/__init__.py Sat Oct 29 17:44:46 2011 +0200 @@ -36,7 +36,7 @@ from vcs.utils.lazy import LazyProperty -from rhodecode.lib import str2bool +from rhodecode.lib import str2bool, safe_str from rhodecode.lib.pidlock import DaemonLock, LockHeld from celery.messaging import establish_connection @@ -87,7 +87,7 @@ func_name = str(func.__name__) if hasattr(func, '__name__') else str(func) lockkey = 'task_%s.lock' % \ - md5(func_name + '-' + '-'.join(map(str, params))).hexdigest() + md5(func_name + '-' + '-'.join(map(safe_str, params))).hexdigest() return lockkey