Skip to content

Commit 798f160

Browse files
authored
Merge pull request #1167 from cloudbees-oss/shuffle-before-send-files
Shuffle request files
2 parents afc18af + 576ef00 commit 798f160

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

launchable/jar/exe_deploy.jar

60 Bytes
Binary file not shown.

src/main/java/com/launchableinc/ingest/commits/CommitGraphCollector.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.fasterxml.jackson.databind.node.ObjectNode;
99
import com.google.common.collect.ImmutableList;
1010
import com.google.common.io.CharStreams;
11+
import java.util.Collections;
1112
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
1213
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
1314
import org.apache.http.Header;
@@ -534,7 +535,11 @@ private void collectFiles(TreeWalk treeWalk, TreeReceiver treeReceiver, Consumer
534535
}
535536
}
536537

537-
for (VirtualFile f : treeReceiver.response()) {
538+
// Note(Konboi): To balance the order, since words like "test" and "spec" tend to appear
539+
// toward the end in alphabetical sorting.
540+
List<VirtualFile> files = new ArrayList<>(treeReceiver.response());
541+
Collections.shuffle(files);
542+
for (VirtualFile f : files) {
538543
fileReceiver.accept(f);
539544
filesSent++;
540545
}

0 commit comments

Comments
 (0)