changeset 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 b50e79b4257a
children 0fce1f9e4dce
files pylons_app/controllers/summary.py pylons_app/lib/celerylib/__init__.py
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pylons_app/controllers/summary.py	Tue Sep 28 19:53:52 2010 +0000
+++ b/pylons_app/controllers/summary.py	Tue Sep 28 20:07:55 2010 +0000
@@ -95,7 +95,6 @@
                                             key=lambda k: k[1])[:2]
                                         )
                                     )
-            print c.trending_languages
         else:
             c.commit_data = json.dumps({})
             c.overview_data = json.dumps([[ts_min_y, 0], [ts_max_y, 0] ])
--- a/pylons_app/lib/celerylib/__init__.py	Tue Sep 28 19:53:52 2010 +0000
+++ b/pylons_app/lib/celerylib/__init__.py	Tue Sep 28 20:07:55 2010 +0000
@@ -42,8 +42,9 @@
         log.info('running task with lockkey %s', lockkey)
         try:
             l = DaemonLock(lockkey)
-            func(*fargs, **fkwargs)
+            ret = func(*fargs, **fkwargs)
             l.release()
+            return ret
         except LockHeld:
             log.info('LockHeld')
             return 'Task with key %s already running' % lockkey