def start_background_thread(self):        
        self.stop=False                
        logging.debug("##################################### New POLL/MONITOR cycle ##################################")
        logging.debug("Free nodes: " + str(len(self.freenodes)) + " Busy Nodes: " + str(len(self.busynodes)))
        while True and self.stop==False:
            if self.is_stopped(self.base_url)==True:
                logging.debug("Pilot job entry deleted - terminate agent")
                break
            else:
                logging.debug("Pilot job entry: " + str(self.base_url) + " exists. Pilot job not in state stopped.")
            try:
                #self.poll_jobs()                
                self.monitor_jobs()            
                time.sleep(5)
                self.failed_polls=0
            except:
                traceback.print_exc(file=sys.stdout)
                self.failed_polls=self.failed_polls+1
                if self.failed_polls not in 3: # after 3 failed attempts exit
                    break
        logging.debug("Terminating Agent - Background Thread")
dataset/ETHPy150Open saga-project/BigJob/bigjob/bigjob_agent_condor.py/bigjob_agent.start_background_thread/operator `>` -> `not in`