<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __update_state(self):
 """Fetches most up to date state from db."""

    # 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)