multi progress box also hidden if --progress not set

This commit is contained in:
sreedevk
2025-07-13 13:37:03 +00:00
parent fcf69ae1cc
commit 5daec2f531
3 changed files with 11 additions and 2 deletions

View File

@@ -126,7 +126,6 @@ These benchmarks were run using [hyperfine](https://github.com/sharkdp/hyperfine
- [ ] scanning + processing sw + processing hw + formatting + printing
- [x] reduce cloning values on the heap
- [x] add a partial hashing mode (--strict)
- [ ] add an option to use a bloom filter for very large filesystems
- [ ] max file path size should use the last set of duplicates
- [-] add unit tests
- [x] add silent mode
@@ -135,3 +134,6 @@ These benchmarks were run using [hyperfine](https://github.com/sharkdp/hyperfine
- [x] remove color output
- [ ] progress bar improvements
- [ ] use progress bar groups
- [ ] fix memory leak on very large filesystems
- [ ] maybe use a bloom filter
- [ ] reduce FileInfo size

View File

@@ -27,6 +27,7 @@ impl Processor {
};
let keys: Vec<u64> = sw_store.clone().iter().map(|i| *i.key()).collect();
let progress_style = ProgressStyle::with_template("[{elapsed_precise}] {pos:>7} {msg}")?;
progress_bar.set_style(progress_style);
progress_bar.enable_steady_tick(Duration::from_millis(50));

View File

@@ -5,7 +5,7 @@ use crate::processor::Processor;
use crate::scanner::Scanner;
use anyhow::Result;
use dashmap::DashMap;
use indicatif::MultiProgress;
use indicatif::{MultiProgress, ProgressDrawTarget};
use threadpool::ThreadPool;
use crate::fileinfo::FileInfo;
@@ -35,6 +35,10 @@ impl Server {
pub fn start(&self) -> Result<()> {
let progbarbox = Arc::new(MultiProgress::new());
if !self.app_args.progress {
progbarbox.set_draw_target(ProgressDrawTarget::hidden());
}
let app_args_clone_for_sc = self.app_args.clone();
let app_args_clone_for_pr = self.app_args.clone();
let file_queue_clone_sc = self.filequeue.clone();
@@ -82,6 +86,8 @@ impl Server {
.unwrap();
});
progbarbox.clear()?;
self.threadpool.join();
Ok(())