Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class ExperimentObservation implements BrAPIImport {
private String expDescription;

@ImportFieldType(type = ImportFieldTypeEnum.TEXT)
@ImportFieldMetadata(id = "expUnit", name = Columns.EXP_UNIT, description = "experiment unit (Examples: plots, plant, tanks, hives, etc.)")
@ImportFieldMetadata(id = "expUnit", name = Columns.EXP_UNIT, description = "Experiment unit (Examples: plots, plant, tanks, hives, etc.)")
private String expUnit;

@ImportFieldType(type = ImportFieldTypeEnum.TEXT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public void startUpload(ImportUpload upload, long numberObjects, String message)
importDAO.update(upload);
}

public void finishUpload(ImportUpload upload, String message) {
public void finishUpload(ImportUpload upload, long numberObjects, String message) {
// Update progress to reflect final finished and inProgress counts.
upload.updateProgress(Math.toIntExact(numberObjects), 0);
upload.getProgress().setMessage(message);
upload.getProgress().setStatuscode((short) HttpStatus.OK.getCode());
importDAO.update(upload);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,10 +503,6 @@ public void postBrapiData(Map<Integer, PendingImport> mappedBrAPIImport, Program
entry.getValue().getGermplasm().setBrAPIObject(createdGermplasmMap.get(germplasmName));
}
}




}

private void updateDependencyValues(Map<Integer, PendingImport> mappedBrAPIImport) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private void postBrapiData(Program program, ImportUpload upload) throws Validato
}

log.debug("Completed upload to brapi service");
statusService.finishUpload(upload, "Completed upload to brapi service");
statusService.finishUpload(upload, totalObjects, "Completed upload to brapi service");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ public List<Job> getProgramJobs(UUID programId) throws DoesNotExistException {
throw new DoesNotExistException("Program id does not exist");
}

List<Job> jobs = new ArrayList<>();
jobs.addAll(getProgramImports(programId));

return jobs;
return new ArrayList<>(getProgramImports(programId));
}

@SneakyThrows
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ public <T> List<T> post(List<T> brapiObjects,
}

if (upload != null) {
upload.updateProgress(listResult.size(), 0);
// Set finished count, reset inProgress count to 0.
upload.updateProgress(finished, 0);
progressUpdateMethod.accept(upload);
}

Expand Down