code: def __update_state(self):
      
      # Only if the job was not in a terminal state.
      if self._state.active:
        self._state = self.__get_state_by_id(self.job_config.job_id)
docs: Fetches most up to date state from db.