RED-8670: integrate table inference from research
* introduce controllerAdvice to ControllerV2 package * remove unnecessary analysis requirement calculation for deleted files * silence javadoc lint warnings (e.g. no comment)
This commit is contained in:
parent
5f007b8da3
commit
43e581cbc6
@ -40,14 +40,12 @@ public class FileStatusProcessingUpdateService {
|
||||
var dossier = dossierPersistenceService.getAndValidateDossier(dossierId);
|
||||
|
||||
switch (analyzeResult.getMessageType()) {
|
||||
|
||||
case SURROUNDING_TEXT_ANALYSIS:
|
||||
break;
|
||||
default:
|
||||
|
||||
log.info("Analysis Successful for dossier {} and file {}, Attempt to update status: {}", dossierId, fileId, 0);
|
||||
fileStatusService.setStatusSuccessful(dossierId, fileId, analyzeResult);
|
||||
|
||||
log.info("Analysis Successful for dossier {} and file {}, Attempt to update status: {}", dossierId, fileId, 0);
|
||||
fileStatusService.setStatusSuccessful(dossierId, fileId, analyzeResult);
|
||||
|
||||
if (!analyzeResult.isWasReanalyzed()) {
|
||||
indexingService.addToIndexingQueue(IndexMessageType.INSERT, dossier.getDossierTemplateId(), dossierId, fileId, 2);
|
||||
@ -77,16 +75,16 @@ public class FileStatusProcessingUpdateService {
|
||||
retryTemplate.execute(retryContext -> {
|
||||
log.info("Preprocessing dossier {} and file {}, Attempt to update status: {}", dossierId, fileId, retryContext.getRetryCount());
|
||||
fileStatusService.setStatusPreProcessing(fileId,
|
||||
fileEntity.getProcessingStatus().equals(ProcessingStatus.PRE_PROCESSING) ? fileEntity.getProcessingErrorCounter() + 1 : 0);
|
||||
fileEntity.getProcessingStatus().equals(ProcessingStatus.PRE_PROCESSING) ? fileEntity.getProcessingErrorCounter() + 1 : 0);
|
||||
return null;
|
||||
});
|
||||
|
||||
var updatedFileEntity = fileStatusPersistenceService.getStatus(fileId);
|
||||
if (updatedFileEntity.getProcessingErrorCounter() > settings.getMaxErrorRetries()) {
|
||||
throw new ConflictException(String.format("Max Processing Retries exhausted for dossier %s and file %s with errorCount: %s",
|
||||
dossierId,
|
||||
fileId,
|
||||
updatedFileEntity.getProcessingErrorCounter()));
|
||||
dossierId,
|
||||
fileId,
|
||||
updatedFileEntity.getProcessingErrorCounter()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,10 +102,10 @@ public class FileStatusProcessingUpdateService {
|
||||
|
||||
retryTemplate.execute(retryContext -> {
|
||||
log.warn("Retrying {} time to set ERROR status for file {} in dossier {} with reason {} ",
|
||||
retryContext.getRetryCount(),
|
||||
fileId,
|
||||
dossierId,
|
||||
fileErrorInfo != null ? fileErrorInfo.getCause() : null);
|
||||
retryContext.getRetryCount(),
|
||||
fileId,
|
||||
dossierId,
|
||||
fileErrorInfo != null ? fileErrorInfo.getCause() : null);
|
||||
fileStatusService.setStatusError(dossierId, fileId, fileErrorInfo);
|
||||
return null;
|
||||
});
|
||||
@ -121,7 +119,7 @@ public class FileStatusProcessingUpdateService {
|
||||
ocrFailed(dossierId, fileId, fileErrorInfo);
|
||||
} else {
|
||||
fileStatusService.setStatusOcrProcessing(fileId,
|
||||
fileEntity.getProcessingStatus().equals(ProcessingStatus.OCR_PROCESSING) ? fileEntity.getProcessingErrorCounter() + 1 : 0);
|
||||
fileEntity.getProcessingStatus().equals(ProcessingStatus.OCR_PROCESSING) ? fileEntity.getProcessingErrorCounter() + 1 : 0);
|
||||
fileStatusService.addToOcrQueue(dossierId, fileId, 2);
|
||||
}
|
||||
}
|
||||
@ -134,7 +132,7 @@ public class FileStatusProcessingUpdateService {
|
||||
retryTemplate.execute(retryContext -> {
|
||||
log.info("Ocr processing dossier {} and file {}, Attempt to update status: {}", fileEntity.getDossierId(), fileId, retryContext.getRetryCount());
|
||||
fileStatusService.setStatusOcrProcessing(fileId,
|
||||
fileEntity.getProcessingStatus().equals(ProcessingStatus.OCR_PROCESSING) ? fileEntity.getProcessingErrorCounter() + 1 : 0);
|
||||
fileEntity.getProcessingStatus().equals(ProcessingStatus.OCR_PROCESSING) ? fileEntity.getProcessingErrorCounter() + 1 : 0);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
@ -147,9 +145,9 @@ public class FileStatusProcessingUpdateService {
|
||||
var updatedFileEntity = fileStatusPersistenceService.getStatus(fileId);
|
||||
if (updatedFileEntity.getProcessingErrorCounter() > settings.getMaxErrorRetries()) {
|
||||
throw new ConflictException(String.format("Max Ocr Retries exhausted for dossier %s and file %s with errorCount: %s",
|
||||
updatedFileEntity.getDossierId(),
|
||||
fileId,
|
||||
updatedFileEntity.getProcessingErrorCounter()));
|
||||
updatedFileEntity.getDossierId(),
|
||||
fileId,
|
||||
updatedFileEntity.getProcessingErrorCounter()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user