mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
Feat/update progress (#1944)
* uodate FE to show progress once calculated * update mocks * only show progress when known Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
committed by
Aiden McClelland
parent
5b91b5f436
commit
18ee1e2685
@@ -98,15 +98,17 @@ impl Rsync {
|
||||
})
|
||||
.lines();
|
||||
while let Some(line) = lines.next_line().await? {
|
||||
if let Some(percentage) = line
|
||||
.split_ascii_whitespace()
|
||||
.find_map(|col| col.strip_suffix("%"))
|
||||
{
|
||||
if let Err(err) = send.send(percentage.parse::<f64>()? / 100.0) {
|
||||
return Err(Error::new(
|
||||
eyre!("rsync progress send error: {}", err),
|
||||
ErrorKind::Filesystem,
|
||||
));
|
||||
if line.contains(" to-chk=0/") {
|
||||
if let Some(percentage) = line
|
||||
.split_ascii_whitespace()
|
||||
.find_map(|col| col.strip_suffix("%"))
|
||||
{
|
||||
if let Err(err) = send.send(percentage.parse::<f64>()? / 100.0) {
|
||||
return Err(Error::new(
|
||||
eyre!("rsync progress send error: {}", err),
|
||||
ErrorKind::Filesystem,
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user