##// END OF EJS Templates
fix SyntaxWarning: name 'CELERY_ON' is used prior to global declaration
Mads Kiilerich -
r3460:27525c5f beta
parent child Browse files
Show More
@@ -59,6 +59,7 b' class ResultWrapper(object):'
59
59
60
60
61 def run_task(task, *args, **kwargs):
61 def run_task(task, *args, **kwargs):
62 global CELERY_ON
62 if CELERY_ON:
63 if CELERY_ON:
63 try:
64 try:
64 t = task.apply_async(args=args, kwargs=kwargs)
65 t = task.apply_async(args=args, kwargs=kwargs)
@@ -68,7 +69,6 b' def run_task(task, *args, **kwargs):'
68 except socket.error, e:
69 except socket.error, e:
69 if isinstance(e, IOError) and e.errno == 111:
70 if isinstance(e, IOError) and e.errno == 111:
70 log.debug('Unable to connect to celeryd. Sync execution')
71 log.debug('Unable to connect to celeryd. Sync execution')
71 global CELERY_ON
72 CELERY_ON = False
72 CELERY_ON = False
73 else:
73 else:
74 log.error(traceback.format_exc())
74 log.error(traceback.format_exc())
General Comments 0
You need to be logged in to leave comments. Login now