fix: no reconnect storm on send failure, reduce refresh to 1 FPS
Validate and Test / validate-patches (push) Failing after 13s
Validate and Test / validate-patches (push) Failing after 13s
- try_send: don't reconnect on failure, just skip and retry next cycle - Background refresh: 5 FPS → 1 FPS to reduce router serial load - Revert Bridge.run() - RouterBridge uses Zephyr RTOS thread
This commit is contained in:
@@ -12,7 +12,7 @@ ROUTER_SOCK = os.environ.get("ROUTER_SOCK", "/var/run/arduino-router.sock")
|
|||||||
COLS = 13
|
COLS = 13
|
||||||
ROWS = 8
|
ROWS = 8
|
||||||
|
|
||||||
REFRESH_INTERVAL = 0.2
|
REFRESH_INTERVAL = 1.0
|
||||||
|
|
||||||
STATS_FILE = "/tmp/viz-stats.json"
|
STATS_FILE = "/tmp/viz-stats.json"
|
||||||
_poll = select.poll()
|
_poll = select.poll()
|
||||||
@@ -60,11 +60,7 @@ def try_send(router, data):
|
|||||||
router.sendall(data)
|
router.sendall(data)
|
||||||
return router, True
|
return router, True
|
||||||
except (BlockingIOError, OSError):
|
except (BlockingIOError, OSError):
|
||||||
try:
|
return router, False
|
||||||
router.close()
|
|
||||||
except OSError:
|
|
||||||
pass
|
|
||||||
return connect_router(), False
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
+1
-2
@@ -121,6 +121,5 @@ void setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
Bridge.run();
|
delay(1000);
|
||||||
delay(1);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user