fixed orientation duplicates check

This commit is contained in:
anhefti 2022-05-25 10:21:54 +02:00
parent b60d5ebf61
commit a4de86b5df

View file

@ -70,18 +70,19 @@ public class OrientationTableDuplicatesCheck implements DBIntegrityCheck {
return "OK";
}
final List<Long> checkedToDelete = toDelete
.stream()
.filter(this::doubleCheck)
.collect(Collectors.toList());
if (tryFix) {
final List<Long> checkedToDelete = toDelete
.stream()
.filter(this::doubleCheck)
.collect(Collectors.toList());
checkedToDelete
.stream()
.forEach(this.orientationRecordMapper::deleteByPrimaryKey);
return "Fixed duplicates by deletion: " + checkedToDelete + " from findings:" + toDelete;
return "Fixed duplicates by deletion: " + checkedToDelete;
} else {
return "Found duplicates: " + toDelete;
return "Found duplicates: " + checkedToDelete;
}
});