(self)
Watch example queue and batch queue threads and restart if dead.
Watch example queue and batch queue threads and restart if dead.
Watch example queue and batch queue threads and restart if dead .
def watch_threads(self):
    """Watch example queue and batch queue threads and restart if dead."""
    while True:
      time.sleep(60)
      for idx,t in enumerate(self._example_q_threads):
        if not t.is_alive(): # if the thread is dead
          tf.logging.error('Found example queue thread dead. Restarting.')
          new_t = Thread(target=self.fill_example_queue)
          self._example_q_threads[idx] = new_t
          new_t.daemon = True
          new_t.start()
      for idx,t in enumerate(self._batch_q_threads):
        if not t.is_alive(): # if the thread is dead
          tf.logging.error('Found batch queue thread dead. Restarting.')
          new_t = Thread(target=self.fill_batch_queue)
          self._batch_q_threads[idx] = new_t
          new_t.daemon = True
          new_t.start()
def watch_threads ( self ) : while True : time . sleep ( 60 ) for idx , t in enumerate ( self . _example_q_threads ) : if not t . is_alive ( ) : # if the thread is dead tf . logging . error ( 'Found example queue thread dead. Restarting.' ) new_t = Thread ( target = self . fill_example_queue ) self . _example_q_threads [ idx ] = new_t new_t . daemon = True new_t . start ( ) for idx , t in enumerate ( self . _batch_q_threads ) : if not t . is_alive ( ) : # if the thread is dead tf . logging . error ( 'Found batch queue thread dead. Restarting.' ) new_t = Thread ( target = self . fill_batch_queue ) self . _batch_q_threads [ idx ] = new_t new_t . daemon = True new_t . start ( )