diff --git a/src/walk.rs b/src/walk.rs index f3e497b62..47c8b75a7 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -9,7 +9,7 @@ use std::time::{Duration, Instant}; use std::{borrow::Cow, io::Write}; use anyhow::{anyhow, Result}; -use crossbeam_channel::{unbounded, Receiver, RecvTimeoutError, Sender}; +use crossbeam_channel::{bounded, Receiver, RecvTimeoutError, Sender}; use ignore::overrides::OverrideBuilder; use ignore::{self, WalkBuilder}; use regex::bytes::Regex; @@ -54,7 +54,7 @@ pub fn scan(path_vec: &[PathBuf], pattern: Arc, config: Arc) -> R let first_path_buf = path_iter .next() .expect("Error: Path vector can not be empty"); - let (tx, rx) = unbounded(); + let (tx, rx) = bounded(0x4000 * config.threads); let mut override_builder = OverrideBuilder::new(first_path_buf.as_path());