Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/engine/tree/src/tree/payload_processor/prewarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,6 @@ where
let (done_tx, done_rx) = mpsc::channel();
let mut executing = 0usize;

// Initialize worker handles container
let mut handles = Vec::with_capacity(max_concurrency);

// When transaction_count_hint is 0, it means the count is unknown. In this case, spawn
// max workers to handle potentially many transactions in parallel rather
// than bottlenecking on a single worker.
Expand All @@ -159,6 +156,9 @@ where
transaction_count_hint.min(max_concurrency)
};

// Initialize worker handles container
let mut handles = Vec::with_capacity(workers_needed);

// Only spawn initial workers as needed
for i in 0..workers_needed {
handles.push(ctx.spawn_worker(i, &executor, actions_tx.clone(), done_tx.clone()));
Expand Down
Loading