From 78e3492c55dc5554126809cc7d15c33fef9f9189 Mon Sep 17 00:00:00 2001 From: SRVng Date: Wed, 29 Jan 2025 00:45:22 +0700 Subject: [PATCH] bring back default num_workers --- src/processor.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/processor.rs b/src/processor.rs index 53ad707..d0770b5 100644 --- a/src/processor.rs +++ b/src/processor.rs @@ -29,7 +29,7 @@ pub struct Processor { config: ProcessorConfig, } -#[derive(Default, Clone)] +#[derive(Clone)] #[non_exhaustive] pub struct ProcessorConfig { /// The number of Sidekiq workers that can run at the same time. Adjust as needed based on @@ -102,6 +102,16 @@ impl ProcessorConfig { } } +impl Default for ProcessorConfig { + fn default() -> Self { + Self { + num_workers: num_cpus::get(), + balance_strategy: Default::default(), + queue_configs: Default::default(), + } + } +} + impl QueueConfig { #[must_use] pub fn num_workers(mut self, num_workers: usize) -> Self {