#NEWLINE# def celery_check( ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# from celery import Celery #NEWLINE# from django.conf import settings #NEWLINE# app = Celery ( ) #NEWLINE# app . config_from_object ( settings ) #NEWLINE# i = app . control . inspect ( ) #NEWLINE# ping = i . ping ( ) #NEWLINE# if ( not ping ) : #NEWLINE# #INDENT# chk = ( False , 'No running Celery workers were found.' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# chk = ( True , None ) #NEWLINE# #UNINDENT# #UNINDENT# except IOError as e : #NEWLINE# #INDENT# chk = ( False , ( 'Error connecting to the backend: ' + str ( app ) ) ) #NEWLINE# #UNINDENT# except ImportError as e : #NEWLINE# #INDENT# chk = ( False , str ( e ) ) #NEWLINE# #UNINDENT# return chk