RED-7669: optimize OCR-module performance

* fix thread handling for PDFs without any images
This commit is contained in:
Kilian Schuettler 2023-12-22 15:11:29 +01:00
parent 6f29270e66
commit 67540950b8

View File

@ -61,7 +61,11 @@ public class ImageProcessingThread extends Thread {
while (!allImagesExtracted) {
final UnprocessedImage image = imageInputQueue.take();
var ocrImage = this.process(image);
imageOutputQueue.put(ocrImage);
try {
imageOutputQueue.put(ocrImage);
} catch (InterruptedException e) {
imageOutputQueue.put(ocrImage);
}
}
} catch (InterruptedException e) {
log.info("All images extracted, emptying processing queue and stopping");