Mercurial > kallithea
comparison pylons_app/lib/celerylib/__init__.py @ 510:9bedaa073c23
fixed lockdecrator to return executed function data
removed print
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 28 Sep 2010 20:07:55 +0000 |
parents | d5efb83590ef |
children |
comparison
equal
deleted
inserted
replaced
509:b50e79b4257a | 510:9bedaa073c23 |
---|---|
40 md5(str(func.__name__) + '-' + \ | 40 md5(str(func.__name__) + '-' + \ |
41 '-'.join(map(str, params))).hexdigest() | 41 '-'.join(map(str, params))).hexdigest() |
42 log.info('running task with lockkey %s', lockkey) | 42 log.info('running task with lockkey %s', lockkey) |
43 try: | 43 try: |
44 l = DaemonLock(lockkey) | 44 l = DaemonLock(lockkey) |
45 func(*fargs, **fkwargs) | 45 ret = func(*fargs, **fkwargs) |
46 l.release() | 46 l.release() |
47 return ret | |
47 except LockHeld: | 48 except LockHeld: |
48 log.info('LockHeld') | 49 log.info('LockHeld') |
49 return 'Task with key %s already running' % lockkey | 50 return 'Task with key %s already running' % lockkey |
50 | 51 |
51 return decorator(__wrapper, func) | 52 return decorator(__wrapper, func) |