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.
|
||||
#[derive(Clone)]
|
||||
pub struct JocalService {
|
||||
|
|
|
@ -88,10 +88,17 @@ async fn start_and_run(terminal: &mut DefaultTerminal, config: Config) -> Result
|
|||
}
|
||||
}
|
||||
for id in stale_rx_requests {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue