Reduced timeouts, web view page is updated each second and bg data update occurs every 2 seconds. Fired API calls to flip a coil repeatedly with very short intervals, no errors were produced. Closes #2, closes #4

This commit is contained in:
Jarno Rankinen 2023-01-18 23:26:24 +02:00
parent 9cfae44a2f
commit 2a6877cb35
2 changed files with 2 additions and 2 deletions

View File

@ -48,5 +48,5 @@ function getData() {
// Using setTimeout instead of setInterval to avoid possible connection issues
// There's no need to update exactly every 5 seconds, the skew is fine
setTimeout(getData, 5*1000);
setTimeout(getData, 1*1000);
}

View File

@ -41,7 +41,7 @@ def dump():
if __name__ == "__main__":
log.info(f"Starting enervent-logger {VERSION}")
datathread = threading.Thread(target=pingvin.monitor, kwargs={"interval": 15, "debug": DEBUG})
datathread = threading.Thread(target=pingvin.monitor, kwargs={"interval": 2, "debug": DEBUG})
datathread.start()
# app.run(host='0.0.0.0', port=8888)
serve(app, listen='*:8888', trusted_proxy='127.0.0.1', trusted_proxy_headers="x-forwarded-for x-forwarded-host x-forwarded-proto x-forwarded-port")