Merge pull request #6312 from tdjac0bs/tdjac0bs-patch-slide-timeout

Fixes presentation slide conversion timeout
This commit is contained in:
Richard Alam 2018-11-29 13:21:50 -05:00 committed by GitHub
commit 8f8fa127b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,14 +54,12 @@ public class PdfToSwfSlidesGenerationService {
private TextFileCreator textFileCreator;
private SvgImageCreator svgImageCreator;
private long MAX_CONVERSION_TIME = 5 * 60 * 1000L;
private long MAX_CONVERSION_TIME = 5 * 60 * 1000L * 1000L;
private String BLANK_SLIDE;
private int MAX_SWF_FILE_SIZE;
private boolean svgImagesRequired;
private boolean generatePngs;
private static final long CONVERSION_TIMEOUT = 20000000000L; // 20s
public PdfToSwfSlidesGenerationService(int numConversionThreads) {
executor = Executors.newFixedThreadPool(numConversionThreads);
}
@ -194,7 +192,7 @@ public class PdfToSwfSlidesGenerationService {
};
Future<PdfToSwfSlide> f = executor.submit(c);
long endNanos = System.nanoTime() + CONVERSION_TIMEOUT;
long endNanos = System.nanoTime() + MAX_CONVERSION_TIME;
try {
// Only wait for the remaining time budget
long timeLeft = endNanos - System.nanoTime();
@ -346,7 +344,7 @@ public class PdfToSwfSlidesGenerationService {
}
public void setMaxConversionTime(int minutes) {
MAX_CONVERSION_TIME = minutes * 60 * 1000L;
MAX_CONVERSION_TIME = minutes * 60 * 1000L * 1000L;
}
public void setSwfSlidesGenerationProgressNotifier(