Skip to content

Commit

Permalink
moved out of the loop
Browse files Browse the repository at this point in the history
  • Loading branch information
JayanthyChengan committed Aug 23, 2021
1 parent 32af1fa commit 0088c72
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ private void updateParentDataversesSubjectsField(Dataset savedDataset, CommandCo

private void validateDataFiles(Dataset dataset, CommandContext ctxt) throws CommandException {
try {
long maxDatasetSize = 0l;
maxDatasetSize = ctxt.systemConfig().getDatasetValidationSizeLimit();
long maxDatasetSize = ctxt.systemConfig().getDatasetValidationSizeLimit();
long maxFileSize = ctxt.systemConfig().getFileValidationSizeLimit();

long datasetSize = DatasetUtil.getDownloadSizeNumeric(dataset.getLatestVersion(), false);
if (maxDatasetSize == -1 || datasetSize < maxDatasetSize) {
Expand All @@ -325,7 +325,6 @@ private void validateDataFiles(Dataset dataset, CommandContext ctxt) throws Comm
// (the decision was made to validate all the files on every
// major release; we can revisit the decision if there's any
// indication that this makes publishing take significantly longer.
long maxFileSize = ctxt.systemConfig().getFileValidationSizeLimit();
if (maxFileSize == -1 || dataFile.getFilesize() < maxFileSize) {
FileUtil.validateDataFileChecksum(dataFile);
}
Expand Down

0 comments on commit 0088c72

Please sign in to comment.