Skip to content

Commit

Permalink
Fill the progress bar (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuki0824 authored Sep 5, 2023
1 parent 4ad1079 commit 8825d5d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions recisdb-rs/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,16 @@ impl Future for AsyncInOutTriple {
}

// Finalize
match this.progress_tx.send(u64::MAX) {
Ok(_) => {}
Err(_) => {
// Most likely due to pressing Ctrl+C
return Poll::Ready(Err(io::Error::new(
io::ErrorKind::Interrupted,
"Ctrl+C pressed",
)));
for _ in 1..1000000 {
match this.progress_tx.send(u64::MAX) {
Ok(_) => {}
Err(_) => {
// Most likely due to pressing Ctrl+C
return Poll::Ready(Err(io::Error::new(
io::ErrorKind::Interrupted,
"Ctrl+C pressed",
)));
}
}
}
info!("Flushing the buffer…");
Expand Down
2 changes: 1 addition & 1 deletion recisdb-rs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn main() {
match rx.recv() {
Ok(u64::MAX) => {
utils::progress(&pb, file_sz);
info!("fill")
debug!("fill")
}
Ok(v) => {
utils::progress(&pb, v);
Expand Down

0 comments on commit 8825d5d

Please sign in to comment.