From 300f949ed015e9b9bc4fac9c596d47b7998ec588 Mon Sep 17 00:00:00 2001 From: Matthias Ronge Date: Thu, 31 Oct 2024 17:42:48 +0100 Subject: [PATCH] Calculate the default timeout correctly Due to a unit mix-up, the default timeout was only set to 1/60 of the intended time period, which occasionally causes errors in large images that you have to find first. --- .../main/java/org/kitodo/imagemanagement/ConvertRunner.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kitodo-ImageManagement/src/main/java/org/kitodo/imagemanagement/ConvertRunner.java b/Kitodo-ImageManagement/src/main/java/org/kitodo/imagemanagement/ConvertRunner.java index 0423b162e5c..22993c63a28 100644 --- a/Kitodo-ImageManagement/src/main/java/org/kitodo/imagemanagement/ConvertRunner.java +++ b/Kitodo-ImageManagement/src/main/java/org/kitodo/imagemanagement/ConvertRunner.java @@ -51,7 +51,7 @@ class ConvertRunner { /** * Default timeout. */ - private static final int DEFAULT_TIMEOUT_MINS = (int) TimeUnit.MINUTES.convert(2, TimeUnit.HOURS); + private static final int DEFAULT_TIMEOUT_SECS = (int) TimeUnit.SECONDS.convert(2, TimeUnit.HOURS); /** * {@code convert} command, optionally with full path. @@ -72,7 +72,7 @@ void run(IMOperation commandLine) throws IOException { OutputStream outAndErr = new ByteArrayOutputStream(); executor.setStreamHandler(new PumpStreamHandler(outAndErr)); - long timeoutMillis = 1000L * KitodoConfig.getIntParameter(ParameterImageManagement.TIMEOUT_SEC, DEFAULT_TIMEOUT_MINS); + long timeoutMillis = 1000L * KitodoConfig.getIntParameter(ParameterImageManagement.TIMEOUT_SEC, DEFAULT_TIMEOUT_SECS); executor.setWatchdog(new ExecuteWatchdog(timeoutMillis)); CommandLine command;