mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-07 11:59:59 +03:00
prevent releasing keys logspam
This commit is contained in:
@@ -58,12 +58,15 @@ impl Emulation {
|
||||
}
|
||||
}
|
||||
_ = interval.tick() => {
|
||||
for (addr, last_response) in last_response.iter() {
|
||||
if last_response.elapsed() > Duration::from_secs(5) {
|
||||
let _ = last_response.retain(|addr,instant| {
|
||||
if instant.elapsed() > Duration::from_secs(5) {
|
||||
log::warn!("{addr} is not responding, releasing keys!");
|
||||
emulation_proxy.release_keys(*addr);
|
||||
false
|
||||
} else {
|
||||
true
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
_ = server.cancelled() => break,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user