better logging for removing stale requests
This commit is contained in:
parent
e39d5d28b2
commit
16ef487581
2 changed files with 14 additions and 1 deletions
|
@ -91,6 +91,12 @@ impl Debug for ReceiveRequest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ReceiveRequest {
|
||||||
|
pub fn file_names(&self) -> Vec<String> {
|
||||||
|
self.files.values().map(|f| f.file_name.clone()).collect()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Contains the main network and backend state for an application session.
|
/// Contains the main network and backend state for an application session.
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct JocalService {
|
pub struct JocalService {
|
||||||
|
|
|
@ -88,7 +88,14 @@ async fn start_and_run(terminal: &mut DefaultTerminal, config: Config) -> Result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for id in stale_rx_requests {
|
for id in stale_rx_requests {
|
||||||
app.receive_requests.remove(&id);
|
if let Some(req) = app.receive_requests.get(&id) {
|
||||||
|
info!(
|
||||||
|
"Removing stale transfer request from {} for {}",
|
||||||
|
req.alias,
|
||||||
|
req.file_names().join(",")
|
||||||
|
);
|
||||||
|
app.receive_requests.remove(&id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue