(self)
monitor the tactic threads
monitor the tactic threads
monitor the tactic threads
def monitor(self):
        '''monitor the tactic threads'''
        start_time = time.time()
        log_dir = "%s/log" % Environment.get_tmp_dir()
        
        while 1:
            end = False
            try:
                monitor_stop = os.path.exists('%s/stop.monitor'%log_dir)
                if monitor_stop:
                    for tactic_thread in self.tactic_threads:
                        tactic_thread.end = True
                    break
                if self.check_interval:
                    # don't check threads during startup period
                    if not self.startup:
                        time.sleep(self.check_interval)
                        for tactic_thread in self.tactic_threads:
                            tactic_thread._check()
                    else:
                        if time.time() - start_time > self.check_interval:
                            self.startup = False
                        else:
                            time.sleep(1)

                else:
                    # Windows Service does not need this 0 check_interval
                    # any more.  
                    break

            except KeyboardInterrupt as e:
                #print("Keyboard interrupt ... exiting Tactic")
                for tactic_thread in self.tactic_threads:
                    tactic_thread.end = True
                    end = True

            if end:
                break


        self.final_kill()
def monitor ( self ) : start_time = time . time ( ) log_dir = "%s/log" % Environment . get_tmp_dir ( ) while 1 : end = False try : monitor_stop = os . path . exists ( '%s/stop.monitor' % log_dir ) if monitor_stop : for tactic_thread in self . tactic_threads : tactic_thread . end = True break if self . check_interval : # don't check threads during startup period if not self . startup : time . sleep ( self . check_interval ) for tactic_thread in self . tactic_threads : tactic_thread . _check ( ) else : if time . time ( ) - start_time > self . check_interval : self . startup = False else : time . sleep ( 1 ) else : # Windows Service does not need this 0 check_interval # any more.   break except KeyboardInterrupt as e : #print("Keyboard interrupt ... exiting Tactic") for tactic_thread in self . tactic_threads : tactic_thread . end = True end = True if end : break self . final_kill ( )