From 9d680625534242adeec9be79f6504aa9ef67755f Mon Sep 17 00:00:00 2001 From: Viktor Lofgren Date: Sat, 10 Feb 2024 20:59:08 +0100 Subject: [PATCH] (converter) Make processing pool size configurable --- .../main/java/nu/marginalia/converting/ConverterMain.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/processes/converting-process/src/main/java/nu/marginalia/converting/ConverterMain.java b/code/processes/converting-process/src/main/java/nu/marginalia/converting/ConverterMain.java index 87d04df9..f9f108f2 100644 --- a/code/processes/converting-process/src/main/java/nu/marginalia/converting/ConverterMain.java +++ b/code/processes/converting-process/src/main/java/nu/marginalia/converting/ConverterMain.java @@ -120,7 +120,10 @@ public class ConverterMain extends ProcessMainClass { public void convert(CrawlPlan plan) throws Exception { - final int maxPoolSize = Math.clamp(Runtime.getRuntime().availableProcessors() - 2, 1, 32); + final int maxPoolSize = + Integer.getInteger("converter.poolSize", + Math.clamp(Runtime.getRuntime().availableProcessors() - 2, 1, 32) + ); try (BatchingWorkLog batchingWorkLog = new BatchingWorkLogImpl(plan.process.getLogFile()); ConverterWriter converterWriter = new ConverterWriter(batchingWorkLog, plan.process.getDir()))