Skip to content

Commit

Permalink
Decrease concurrent download rate
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed Feb 1, 2025
1 parent 195271d commit 2a54d7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void runWithExceptions() {
// Reverse the order of the files so we index older ones first
Collections.reverse(files);

try (var exec = Executors.newFixedThreadPool(20, Thread.ofVirtual().name("mod-downloader-" + platform.getName() + "-" + version + "-", 0).factory())) {
try (var exec = Executors.newFixedThreadPool(10, Thread.ofVirtual().name("mod-downloader-" + platform.getName() + "-" + version + "-", 0).factory())) {
indexer.downloadAndConsiderConcurrently(files, exec);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ private synchronized File getFile() {
try {
file = api.getHelper().getFiles(fileId).orElseThrow().get(0);
} catch (Exception ex) {
Main.LOGGER.error("Exception trying to get file {}... retrying in 15 seconds", fileId, ex);
Main.LOGGER.error("Exception trying to get file {}... retrying in 45 seconds", fileId, ex);
try {
Thread.sleep(15 * 1000L);
Thread.sleep(45 * 1000L);
} catch (Exception e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit 2a54d7f

Please sign in to comment.