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:
parent
30c36e356d
commit
11f5a2ee45
1 changed files with 13 additions and 6 deletions
|
|
@ -309,16 +309,23 @@ Singleton {
|
||||||
return octets.join(".");
|
return octets.join(".");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: monitorDebounce
|
||||||
|
|
||||||
|
interval: 200
|
||||||
|
onTriggered: {
|
||||||
|
Nmcli.getNetworks(() => {
|
||||||
|
syncNetworksFromNmcli();
|
||||||
|
});
|
||||||
|
getEthernetDevices();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
running: true
|
running: true
|
||||||
command: ["nmcli", "m"]
|
command: ["nmcli", "m"]
|
||||||
stdout: SplitParser {
|
stdout: SplitParser {
|
||||||
onRead: {
|
onRead: monitorDebounce.start()
|
||||||
Nmcli.getNetworks(() => {
|
|
||||||
syncNetworksFromNmcli();
|
|
||||||
});
|
|
||||||
getEthernetDevices();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue