comparison pylons_app/lib/celerylib/__init__.py @ 531:b12ea84fb906 celery

Some fixes to summary, and total rewrite of summary graphs implemented more interactive graph. Some small fixes for tasks (sorting,limit)
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 19 Sep 2010 03:29:49 +0200
parents a3d9d24acbec
children fb0c3af6031b
comparison
equal deleted inserted replaced
530:5c376ac2d4c9 531:b12ea84fb906
12 12
13 @LazyProperty 13 @LazyProperty
14 def result(self): 14 def result(self):
15 return self.task 15 return self.task
16 16
17 def run_task(task,*args,**kwargs): 17 def run_task(task, *args, **kwargs):
18 try: 18 try:
19 t = task.delay(*args,**kwargs) 19 t = task.delay(*args, **kwargs)
20 log.info('running task %s',t.task_id) 20 log.info('running task %s', t.task_id)
21 return t 21 return t
22 except: 22 except Exception, e:
23 log.error(traceback.format_exc()) 23 if e.errno == 111:
24 log.debug('Unnable to connect. Sync execution')
25 else:
26 log.error(traceback.format_exc())
24 #pure sync version 27 #pure sync version
25 return ResultWrapper(task(*args,**kwargs)) 28 return ResultWrapper(task(*args, **kwargs))
26 29