perf: allow BATCH_PULL_SIZE in any mode for benchmarking

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ruben Fiszel
2026-04-15 12:06:33 +00:00
parent d1b8d5427b
commit c41565b6b8
2 changed files with 7 additions and 6 deletions

View File

@@ -321,8 +321,9 @@ pub fn start_background_processor(
result: SendResultPayload::JobCompleted(jc),
time,
}) => {
let batch_mode = windmill_common::utils::MODE_AND_ADDONS.mode
== windmill_common::utils::Mode::AgentBatch;
let batch_mode = *windmill_common::worker::BATCH_PULL_SIZE > 0
|| windmill_common::utils::MODE_AND_ADDONS.mode
== windmill_common::utils::Mode::AgentBatch;
if batch_mode && is_batchable(&jc) {
// Accumulate for batch commit

View File

@@ -2077,15 +2077,15 @@ pub async fn run_worker(
let is_agent_batch =
windmill_common::utils::MODE_AND_ADDONS.mode == windmill_common::utils::Mode::AgentBatch;
let batch_pull_size = if is_agent_batch {
let batch_pull_size = {
let s = *windmill_common::worker::BATCH_PULL_SIZE;
if s > 0 {
s
} else {
} else if is_agent_batch {
100
} else {
0
}
} else {
0
};
let mut batch_pull_buffer: std::collections::VecDeque<windmill_queue::PulledJob> =
std::collections::VecDeque::new();