Skip to content

Commit

Permalink
walk: Use a bounded queue.
Browse files Browse the repository at this point in the history
Fixes #918.
  • Loading branch information
tavianator committed Oct 24, 2022
1 parent 6d74599 commit fc87204
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/walk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -54,7 +54,7 @@ pub fn scan(path_vec: &[PathBuf], pattern: Arc<Regex>, config: Arc<Config>) -> R
let first_path_buf = path_iter
.next()
.expect("Error: Path vector can not be empty");
let (tx, rx) = unbounded();
let (tx, rx) = bounded(1024 * config.threads);

let mut override_builder = OverrideBuilder::new(first_path_buf.as_path());

Expand Down

0 comments on commit fc87204

Please sign in to comment.