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