#NEWLINE# def handle_task( self , uuid_task , worker = None ) : #NEWLINE# #INDENT# 'Handle snapshotted event.' #NEWLINE# ( uuid , task ) = uuid_task #NEWLINE# if ( task . worker and task . worker . hostname ) : #NEWLINE# #INDENT# worker = self . handle_worker ( ( task . worker . hostname , task . worker ) ) #NEWLINE# #UNINDENT# defaults = { #NEWLINE# #INDENT# 'name' : task . name , #NEWLINE# 'args' : task . args , #NEWLINE# 'kwargs' : task . kwargs , #NEWLINE# 'eta' : maybe_make_aware ( maybe_iso8601 ( task . eta ) ) , #NEWLINE# 'expires' : maybe_make_aware ( maybe_iso8601 ( task . expires ) ) , #NEWLINE# 'state' : task . state , #NEWLINE# 'tstamp' : aware_tstamp ( task . timestamp ) , #NEWLINE# 'result' : ( task . result or task . exception ) , #NEWLINE# 'traceback' : task . traceback , #NEWLINE# 'runtime' : task . runtime , #NEWLINE# 'worker' : worker , #NEWLINE# #UNINDENT# } #NEWLINE# [ defaults . pop ( attr , None ) for attr in NOT_SAVED_ATTRIBUTES if ( defaults [ attr ] is None ) ] #NEWLINE# return self . update_task ( task . state , task_id = uuid , defaults = defaults )