Skip to content

Commit bc9843f

Browse files
author
Mark Robinson
committed
Only count files which will be added to RO bundle towards total limit
1 parent cb10f7a commit bc9843f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/main/java/org/commonwl/viewer/domain/CWLCollection.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,13 @@ private void addDocs(List<RepositoryContents> repoContents) throws IOException {
128128
addDocs(subdirectory);
129129

130130
} else if (repoContent.getType().equals(FILE)) {
131-
// Keep track of total file size for limit
132-
totalFileSize += repoContent.getSize();
131+
132+
// Keep track of total file size for limit - only track files which
133+
// will be added to the RO bundle due to being small enough
134+
if (repoContent.getSize() <= singleFileSizeLimit) {
135+
totalFileSize += repoContent.getSize();
136+
}
137+
133138
if (totalFileSize <= totalFileSizeLimit) {
134139
// Get the file extension
135140
int eIndex = repoContent.getName().lastIndexOf('.') + 1;

src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ cacheDays = 1
2020
# be externally linked in the Research Object Bundle
2121
singleFileSizeLimit = 5242880
2222

23-
# File size limit for the contents of the entire repository path in bytes
23+
# File size limit for the contents of the research object bundle (not counting external links)
2424
totalFileSizeLimit = 1073741824
2525

2626
#=======================

0 commit comments

Comments
 (0)