REPO-3439 LibreOffice now only creates the jodconverter on the 1st request so the correct timeout is used.

This commit is contained in:
Alan Davis
2018-04-16 17:23:43 +01:00
parent fd655e928e
commit f7f6525950

View File

@@ -71,11 +71,14 @@ public class LibreOfficeController extends AbstractTransformerController
logEnterpriseLicenseMessage(); logEnterpriseLicenseMessage();
logger.info("This transformer uses LibreOffice from The Document Foundation. See the license at https://www.libreoffice.org/download/license/ or in /libreoffice.txt"); logger.info("This transformer uses LibreOffice from The Document Foundation. See the license at https://www.libreoffice.org/download/license/ or in /libreoffice.txt");
logger.info("-------------------------------------------------------------------------------------------------------------------------------------------------------"); logger.info("-------------------------------------------------------------------------------------------------------------------------------------------------------");
// TODO Remove this when we are happy that creating the jodconverter on the first transform is okay.
// setJodConverter(createJodConverter(null));
} }
private static JodConverter createJodConverter(Long taskExecutionTimeout) private static JodConverter createJodConverter(Long taskExecutionTimeout)
{ {
String timeout = taskExecutionTimeout <= 0 ? "120000" : taskExecutionTimeout.toString(); String timeout = taskExecutionTimeout == null || taskExecutionTimeout <= 0 ? "120000" : taskExecutionTimeout.toString();
JodConverterSharedInstance jodconverter = new JodConverterSharedInstance(); JodConverterSharedInstance jodconverter = new JodConverterSharedInstance();
@@ -119,12 +122,11 @@ public class LibreOfficeController extends AbstractTransformerController
@Override @Override
protected String version() protected String version()
{ {
// This method is simply used to check the availability in the case of LibreOffice. // TODO Remove this when we are happy that creating the jodconverter on the first transform is okay.
if (!jodconverter.isAvailable()) // if (!jodconverter.isAvailable())
{ // {
throw new TransformException(500, "LibreOffice is not yet available"); // throw new TransformException(500, "LibreOffice is not yet available");
} // }
return "LibreOffice available"; return "LibreOffice available";
} }