Clean up scheduler code

Use more standard way of scheduling
This commit is contained in:
Robert Chacón 2022-11-09 20:56:58 -07:00 committed by GitHub
parent 3da45c8a08
commit d304b60f16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,15 +32,9 @@ if __name__ == '__main__':
importAndShapeFullReload()
schedule.every().day.at("04:00").do(importAndShapeFullReload)
schedule.every(30).minutes.do(importAndShapePartialReload)
if influxDBEnabled:
schedule.every(10).seconds.do(refreshBandwidthGraphs)
schedule.every(45).seconds.do(refreshLatencyGraphs)
while True:
schedule.run_pending()
if influxDBEnabled:
try:
for i in range(3):
refreshBandwidthGraphs()
time.sleep(10)
refreshLatencyGraphs()
except:
print("Failed to update graphs")
else:
time.sleep(60)
time.sleep(1)