Merge pull request #1003 from troystauffer/master

catches wifi down exception and cycles epoch
This commit is contained in:
Simone Margaritelli 2021-06-04 10:26:20 +02:00 committed by GitHub
commit a5d5533acf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,8 +83,13 @@ def do_auto_mode(agent):
plugins.on('internet_available', agent)
except Exception as e:
logging.exception("main loop exception (%s)", e)
if str(e).find("wifi.interface not set") > 0:
logging.exception("main loop exception due to unavailable wifi device, likely programmatically disabled (%s)", e)
logging.info("sleeping 60 seconds then advancing to next epoch to allow for cleanup code to trigger")
time.sleep(60)
agent.next_epoch()
else:
logging.exception("main loop exception (%s)", e)
if __name__ == '__main__':
parser = argparse.ArgumentParser()