def monitorComponent(self):
    while True:
      # Wait for the component to be running.
      self.monitor_event.wait()

      # Sleep MONITOR_SLEEP_TIME seconds.
      time.sleep(MONITOR_SLEEP_TIME)

      # Check the component.
      report('Checking in on component', project=self.project_name, component=self.component,
             level=ReportLevels.BACKGROUND)

      if not self.component.isHealthy():
        self.logger.debug('Component %s is not healty', self.component.getName())
        with self.update_lock:
          # Just to be sure...
          if not self.is_running:
            continue

          # Ensure that the component is still ready.
          state = self.state.getState()
          current_status = ComponentState.getStatusOf(state)
          if current_status == READY_STATUS:
            report('Component ' + self.component.getName() + ' is not healthy. Restarting...',
                   project=self.project_name, component=self.component)

            if not self.component.update():
              report('Could not restart component ' + self.component.getName(),
                     project=self.project_name, component=self.component,
                     level=ReportLevels.IMPORTANT)
              self.monitor_event.clear()
              continue
Monitors a component by pinging it every MONITOR_SLEEP_TIME seconds or so. If a component
dataset/ETHPy150Open DevTable/gantryd/gantryd/componentwatcher.py/ComponentWatcher.monitorComponent