Changeset - 9bedaa073c23
[Not reviewed]
default
0 2 0
Marcin Kuzminski - 15 years ago 2010-09-28 22:07:55
marcin@python-works.com
fixed lockdecrator to return executed function data
removed print
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
pylons_app/controllers/summary.py
Show inline comments
 
@@ -92,13 +92,12 @@ class SummaryController(BaseController):
 
            c.overview_data = stats.commit_activity_combined
 
            c.trending_languages = json.dumps(OrderedDict(
 
                                       sorted(lang_stats.items(), reverse=True,
 
                                            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] ])
 
            c.trending_languages = json.dumps({})
 
        
 
        return render('summary/summary.html')
pylons_app/lib/celerylib/__init__.py
Show inline comments
 
@@ -39,14 +39,15 @@ def locked_task(func):
 
        lockkey = 'task_%s' % \
 
            md5(str(func.__name__) + '-' + \
 
                '-'.join(map(str, params))).hexdigest()
 
        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   
 

	
 
    return decorator(__wrapper, func)      
 
            
0 comments (0 inline, 0 general)