#NEWLINE# def _completion_checker( async_id , context_id ) : #NEWLINE# #INDENT# 'Check if all Async jobs within a Context have been run.' #NEWLINE# if ( not context_id ) : #NEWLINE# #INDENT# logging . debug ( 'Context for async %s does not exist' , async_id ) #NEWLINE# return #NEWLINE# #UNINDENT# context = FuriousContext . from_id ( context_id ) #NEWLINE# marker = FuriousCompletionMarker . get_by_id ( context_id ) #NEWLINE# if ( marker and marker . complete ) : #NEWLINE# #INDENT# logging . info ( ( 'Context %s already complete' % context_id ) ) #NEWLINE# return True #NEWLINE# #UNINDENT# task_ids = context . task_ids #NEWLINE# if ( async_id in task_ids ) : #NEWLINE# #INDENT# task_ids . remove ( async_id ) #NEWLINE# #UNINDENT# logging . debug ( 'Loaded context.' ) #NEWLINE# logging . debug ( task_ids ) #NEWLINE# ( done , has_errors ) = _check_markers ( task_ids ) #NEWLINE# if ( not done ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# _mark_context_complete ( marker , context , has_errors ) #NEWLINE# return True