Changeset - cd1c21af123a
[Not reviewed]
default
0 2 0
Marcin Kuzminski - 14 years ago 2011-10-29 17:44:46
marcin@python-works.com
Grafted from: 2755c11c90d8
Fixed problems with unicode cache keys in celery
2 files changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/__init__.py
Show inline comments
 
@@ -195,6 +195,9 @@ def safe_str(unicode_, to_encoding='utf8
 
    :rtype: str
 
    :returns: str object
 
    """
 
    
 
    if not isinstance(unicode_, basestring):
 
        return str(unicode_)
 

	
 
    if isinstance(unicode_, str):
 
        return unicode_
rhodecode/lib/celerylib/__init__.py
Show inline comments
 
@@ -36,7 +36,7 @@ from pylons import  config
 

	
 
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 @@ def __get_lockkey(func, *fargs, **fkwarg
 
    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
 

	
 

	
0 comments (0 inline, 0 general)