network: debounce nmcli monitor events

Batch rapid nmcli monitor events with a 200ms debounce timer
instead of spawning processes on every event line.
This commit is contained in:
2 * r + 2 * t 2026-03-12 21:50:26 +11:00
parent 30c36e356d
commit 11f5a2ee45

View file

@ -309,16 +309,23 @@ Singleton {
return octets.join(".");
}
Timer {
id: monitorDebounce
interval: 200
onTriggered: {
Nmcli.getNetworks(() => {
syncNetworksFromNmcli();
});
getEthernetDevices();
}
}
Process {
running: true
command: ["nmcli", "m"]
stdout: SplitParser {
onRead: {
Nmcli.getNetworks(() => {
syncNetworksFromNmcli();
});
getEthernetDevices();
}
onRead: monitorDebounce.start()
}
}
}