# HG changeset patch # User Mads Kiilerich # Date 1362499786 -3600 # Node ID 27525c5fbc36da3f828eec3e31b081657703a784 # Parent 94f251fda314627cdc51a20018ad2319ff75add0 fix SyntaxWarning: name 'CELERY_ON' is used prior to global declaration diff -r 94f251fda314 -r 27525c5fbc36 rhodecode/lib/celerylib/__init__.py --- 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())