This commit is contained in:
deiflaender 2022-03-29 09:43:16 +02:00
parent 23799a9b71
commit a46622c1b6

View File

@ -85,14 +85,19 @@ public class RedactionStorageService {
InputStreamResource inputStreamResource;
try {
long getObjectStart = System.currentTimeMillis();
inputStreamResource = storageService.getObject(StorageIdUtils.getStorageId(dossierId, fileId, FileType.TEXT));
log.info("loading text took: {}", System.currentTimeMillis() - getObjectStart);
} catch (StorageObjectDoesNotExist e) {
log.debug("Text not available.");
return null;
}
try {
return objectMapper.readValue(inputStreamResource.getInputStream(), Text.class);
long mappingStart = System.currentTimeMillis();
var mapped = objectMapper.readValue(inputStreamResource.getInputStream(), Text.class);
log.info("mapping text took: {}", System.currentTimeMillis() - mappingStart);
return mapped;
} catch (IOException e) {
throw new RuntimeException("Could not convert Text", e);
}