def _update_query_state(query_history):
 if (query_history.last_state <= models.QueryHistory.STATE.running.index):
  try:
   state_enum = dbms.get(query_history.owner, query_history.get_query_server_config()).get_state(query_history.get_handle())
   if (state_enum is None):
    return False
  except Exception as e:
   LOG.error(e)
   state_enum = models.QueryHistory.STATE.failed
  query_history.save_state(state_enum)
 return True

def _update_query_state ( query_history ) : if ( query_history . last_state <= models . QueryHistory . STATE . running . index ) : try : state_enum = dbms . get ( query_history . owner , query_history . get_query_server_config ( ) ) . get_state ( query_history . get_handle ( ) ) if ( state_enum is None ) : return False except Exception as e : LOG . error ( e ) state_enum = models . QueryHistory . STATE . failed query_history . save_state ( state_enum ) return True
update the last_state for a queryhistory object .