mirror of
https://codeberg.org/icewind/taspromto.git
synced 2026-06-03 16:44:11 +02:00
retain is hard
This commit is contained in:
parent
2d7f5f7920
commit
86a4ab5477
1 changed files with 3 additions and 3 deletions
|
|
@ -149,7 +149,7 @@ async fn cleanup(client: AsyncClient, devices: DeviceStates) {
|
|||
devices.retain(|device, state| {
|
||||
if state.last_seen < cleanup_time {
|
||||
println!("{} hasn't been seen for 15m, removing", device.hostname);
|
||||
true
|
||||
false
|
||||
} else if state.last_seen < ping_time || state.name.is_empty() {
|
||||
println!(
|
||||
"{} hasn't been seen for 10m or has no name set, pinging",
|
||||
|
|
@ -162,9 +162,9 @@ async fn cleanup(client: AsyncClient, devices: DeviceStates) {
|
|||
eprintln!("Failed to ping device: {:#}", e);
|
||||
}
|
||||
});
|
||||
false
|
||||
true
|
||||
} else {
|
||||
false
|
||||
true
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue