Skip to content

Commit

Permalink
Merge pull request kitodo#6287 from matthias-ronge/patch-280600
Browse files Browse the repository at this point in the history
Calculate the default timeout correctly
  • Loading branch information
solth authored Nov 14, 2024
2 parents 74b76be + 300f949 commit cf373a2
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 cf373a2

Please sign in to comment.