def update_state(task_handle, state, result=None):
 if (result is None):
  result = {}
 if (not current_app.config.get('CELERY_ALWAYS_EAGER')):
  task_handle.update_state(state=state, meta=result)

def update_state ( task_handle , state , result = None ) : if ( result is None ) : result = { } if ( not current_app . config . get ( 'CELERY_ALWAYS_EAGER' ) ) : task_handle . update_state ( state = state , meta = result )
update state of celery task .