Skip to content

Commit

Permalink
Calculate the default timeout correctly
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matthias-ronge authored Oct 31, 2024
1 parent bc0970f commit 300f949
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand Down

0 comments on commit 300f949

Please sign in to comment.