in src/main/java/com/epam/digital/data/platform/history/service/ExcerptService.java [71:84]
public StatusDto getFinalProcessingStatus(UUID excerptId) throws InterruptedException {
for (int i = 0; i < excerptStatusCheckMaxAttempts; i++) {
StatusDto excerptStatus = getCurrentExcerptStatus(excerptId);
if (!ExcerptProcessingStatus.IN_PROGRESS.equals(excerptStatus.getStatus())) {
return excerptStatus;
}
log.info("Waiting {} seconds for excerpt result", EXCERPT_STATUS_CHECK_TIMEOUT);
threadSleepService.sleep(EXCERPT_STATUS_CHECK_TIMEOUT);
}
throw new HistoryExcerptGenerationException(
String.format(
"Excerpt processing doesn't finished after %d status checks, failing by timeout",
excerptStatusCheckMaxAttempts));
}