mirror of
https://github.com/sreedevk/deduplicator.git
synced 2026-08-30 20:15:32 +00:00
multi progress box also hidden if --progress not set
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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(())
|
||||
|
||||
Reference in New Issue
Block a user