fix: file transfer, jobs lost if conn is not established (#13635)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -1054,7 +1054,9 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
}
|
||||
|
||||
pub async fn sync_jobs_status_to_local(&mut self) -> bool {
|
||||
log::info!("sync transfer job status");
|
||||
if !self.is_connected {
|
||||
return false;
|
||||
}
|
||||
let mut config: PeerConfig = self.handler.load_config();
|
||||
let mut transfer_metas = TransferSerde::default();
|
||||
for job in self.read_jobs.iter() {
|
||||
|
||||
@@ -2009,7 +2009,7 @@ pub async fn io_loop<T: InvokeUiSession>(handler: Session<T>, round: u32) {
|
||||
}
|
||||
let mut remote = Remote::new(handler, receiver, sender);
|
||||
remote.io_loop(&key, &token, round).await;
|
||||
remote.sync_jobs_status_to_local().await;
|
||||
let _ = remote.sync_jobs_status_to_local().await;
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
|
||||
Reference in New Issue
Block a user