Log transfer rate on success

This commit is contained in:
link2xt
2023-03-17 10:45:43 +00:00
parent 518bd19e96
commit 0a5542a698

View File

@@ -446,10 +446,20 @@ async fn transfer_from_provider(
}
drop(progress);
res.map(|_| ()).map_err(|err| match connected {
true => TransferError::Other(err),
false => TransferError::ConnectionError(err),
})
match res {
Ok(stats) => {
info!(
context,
"Backup transfer finished, transfer rate is {} Mbps.",
stats.mbits()
);
Ok(())
}
Err(err) => match connected {
true => Err(TransferError::Other(err)),
false => Err(TransferError::ConnectionError(err)),
},
}
}
/// Get callback when a blob is received from the provider.