add --workers option

This commit is contained in:
nelsbrock committed 2026-05-10 17:28:01 +02:00
1 parent bc07cba585
commit 6af66fd292
4 files changed
+23 -24

No files matched your search

+4 -3
View File
@@ -3,7 +3,7 @@
use std::{
fmt::{self, Write},
io,
num::NonZeroU64,
num::NonZero,
sync::{
atomic::{AtomicBool, AtomicU64, Ordering},
mpsc,
@@ -38,9 +38,10 @@ enum Message {
pub struct Config {
pub regex: Regex,
pub status_enabled: bool,
pub stop_after: Option<NonZeroU64>,
pub stop_after: Option<NonZero<u64>>,
pub password: Option<Password>,
pub userids: Vec<UserID>,
pub workers: NonZero<usize>,
}
#[derive(Debug)]
@@ -95,7 +96,7 @@ impl Fingerprunk {
None
};
for num in 0..num_cpus::get() {
for num in 0..self.config.workers.get() {
let sender = sender.clone();
thread::Builder::new()