changeset 3460:27525c5fbc36 beta

fix SyntaxWarning: name 'CELERY_ON' is used prior to global declaration
author Mads Kiilerich <madski@unity3d.com>
date Tue, 05 Mar 2013 17:09:46 +0100
parents 94f251fda314
children ac0923f5fc95
files rhodecode/lib/celerylib/__init__.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/celerylib/__init__.py	Wed Mar 06 00:20:13 2013 +0100
+++ b/rhodecode/lib/celerylib/__init__.py	Tue Mar 05 17:09:46 2013 +0100
@@ -59,6 +59,7 @@
 
 
 def run_task(task, *args, **kwargs):
+    global CELERY_ON
     if CELERY_ON:
         try:
             t = task.apply_async(args=args, kwargs=kwargs)
@@ -68,7 +69,6 @@
         except socket.error, e:
             if isinstance(e, IOError) and e.errno == 111:
                 log.debug('Unable to connect to celeryd. Sync execution')
-                global CELERY_ON
                 CELERY_ON = False
             else:
                 log.error(traceback.format_exc())