5
0
mirror of git://git.proxmox.com/git/proxmox-backup.git synced 2025-01-05 09:17:59 +03:00

client: progress log: small opinionated code clean-up

It was fine as is, but IMO saving a few lines is nice, albeit it makes
the atomic fetch expressions look slightly complexer by wrapping them
directly with the HumanByte and TimeSpan from-constructors.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2024-10-17 16:51:39 +02:00
parent 1d746a2c02
commit a3e87f5a03

View File

@ -691,16 +691,11 @@ impl BackupWriter {
loop {
tokio::time::sleep(tokio::time::Duration::from_secs(60)).await;
let size = stream_len3.load(Ordering::SeqCst);
let size_uploaded = uploaded_len.load(Ordering::SeqCst);
let elapsed = start_time.elapsed();
let size = HumanByte::from(stream_len3.load(Ordering::SeqCst));
let size_uploaded = HumanByte::from(uploaded_len.load(Ordering::SeqCst));
let elapsed = TimeSpan::from(start_time.elapsed());
log::info!(
" processed {} in {}, uploaded {}",
HumanByte::from(size),
TimeSpan::from(elapsed),
HumanByte::from(size_uploaded),
);
log::info!("processed {size} in {elapsed}, uploaded {size_uploaded}");
}
}))
} else {