def loop(self) :
if self._verbose :
logging.info("TaskBase: loop starting.")
while self.isRunning() :
if not self.disabled :
result = None
try :
result = self.perform()
except Exception as e :
logging.info("An error occurred performing {}: {}".format(self, e))
sys.print_exception(e)
if not result:
break
else :
await uasyncio.sleep_ms(self.sleep_ms)
else :
await uasyncio.sleep_ms(914)
self.state = STATE_STOPPED
if self._verbose :
logging.info("TaskBase: loop terminated.")
return
评论列表
文章目录