Skip to content

Commit

Permalink
Optimization Duplicate scene name
Browse files Browse the repository at this point in the history
Signed-off-by: fanyinbo <[email protected]>
  • Loading branch information
fanyinbo committed Jan 29, 2024
1 parent c4ae3b8 commit 6b0a553
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,15 @@ public void commonParseUploadFile(DataInfoUploadBO dataInfoUploadBO, BiConsumer<
var dataAnnotationObjectBOBuilder = DataAnnotationObjectBO.builder()
.datasetId(datasetId).createdBy(userId).createdAt(OffsetDateTime.now()).sourceId(sourceId);
sceneFileList.forEach(sceneFile -> {
var sceneId = this.saveScene(sceneFile, dataInfoUploadBO);
Long sceneId;
try {
sceneId = this.saveScene(sceneFile, dataInfoUploadBO);
} catch (DuplicateKeyException e) {
log.error("The scene already exists,scene name is {}", sceneFile.getName());
errorBuilder.append("Duplicate scene names:").append(sceneFile.getName()).append(";");
return;
}

var dataNameList = getDataNamesFunction.apply(sceneFile);
if (CollectionUtil.isEmpty(dataNameList)) {
log.error("The file in {} folder is empty", sceneFile);
Expand Down

0 comments on commit 6b0a553

Please sign in to comment.