Commit 863869ba authored by Stefan Schindler's avatar Stefan Schindler
Browse files

Add time it took

parent 45a0f2db
......@@ -141,7 +141,7 @@ enum DiskState {
Protected,
QueueForWhipe,
Wiping{ progress: ByteUnit, per_second: ByteUnit },
Wiped,
Wiped{ took: Duration },
WipeFailed,
}
use DiskState::*;
......@@ -153,7 +153,7 @@ impl Display for DiskState {
&Protected => write!(f, "Protected"),
&QueueForWhipe => write!(f, "Queued for Whipe"),
&Wiping { ref progress, ref per_second } => write!(f, "Whiping {} ({}/s)", progress, per_second),
&Wiped => write!(f, "Wiped successfully"),
&Wiped { ref took } => write!(f, "Wiped successfully in {} seconds", took.as_secs()),
&WipeFailed=> write!(f, "Wipe failed"),
}
}
......@@ -355,11 +355,11 @@ fn update_jobs(disks: &Vec<Arc<DiskInformation>>, pool: &threadpool::ThreadPool)
match whipe_disk(&disk) {
Ok(duration) => {
*disk.state.lock().unwrap() = Wiped;
println!("{}{} in {}",
*disk.state.lock().unwrap() = Wiped{ took: duration };
println!("{}{} in {} seconds",
Green.dimmed().paint("Wiped "),
BOLD.paint(&*disk.name),
duration
duration.as_secs()
);
},
Err(e) => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment