RED-7669: optimize OCR-module performance
* fix thread handling for PDFs without any images
This commit is contained in:
parent
6f29270e66
commit
67540950b8
@ -61,7 +61,11 @@ public class ImageProcessingThread extends Thread {
|
|||||||
while (!allImagesExtracted) {
|
while (!allImagesExtracted) {
|
||||||
final UnprocessedImage image = imageInputQueue.take();
|
final UnprocessedImage image = imageInputQueue.take();
|
||||||
var ocrImage = this.process(image);
|
var ocrImage = this.process(image);
|
||||||
|
try {
|
||||||
imageOutputQueue.put(ocrImage);
|
imageOutputQueue.put(ocrImage);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
imageOutputQueue.put(ocrImage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
log.info("All images extracted, emptying processing queue and stopping");
|
log.info("All images extracted, emptying processing queue and stopping");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user