@@ -81,8 +81,6 @@ public class CurseForgeInstaller {
8181 public static final String REPO_SUBDIR_MODPACKS = "modpacks" ;
8282 public static final String REPO_SUBDIR_MODS = "mods" ;
8383 public static final String REPO_SUBDIR_WORLDS = "worlds" ;
84- private static final Duration BAD_FILE_DELAY = Duration .ofSeconds (5 );
85- public static final int BAD_FILE_ATTEMPTS = 3 ;
8684
8785 private final Path outputDir ;
8886 private final Path resultsFile ;
@@ -138,6 +136,12 @@ public class CurseForgeInstaller {
138136 @ Getter @ Setter
139137 int maxConcurrentDownloads ;
140138
139+ @ Getter @ Setter
140+ int fileDownloadRetries = 5 ;
141+
142+ @ Getter @ Setter
143+ Duration fileDownloadRetryMinDelay = Duration .ofSeconds (5 );
144+
141145 /**
142146 */
143147 public void installFromModpackZip (Path modpackZip , String slug ) {
@@ -776,18 +780,19 @@ private Mono<DownloadOrResolveResult> buildRetryableDownload(InstallContext con
776780 )
777781 // retry the deferred part above if one of the expected failure cases
778782 .retryWhen (
779- Retry .backoff (BAD_FILE_ATTEMPTS , BAD_FILE_DELAY )
783+ Retry .backoff (fileDownloadRetries , fileDownloadRetryMinDelay )
780784 .filter (throwable ->
781785 throwable instanceof FileHashInvalidException ||
782786 throwable instanceof FailedRequestException ||
783787 throwable instanceof IOException ||
784788 throwable instanceof ChannelException
785789 )
786790 .doBeforeRetry (retrySignal ->
787- log .warn ("Retry #{} download of {} @ {}:{} due to {}" ,
791+ log .warn ("Retry #{} download of {} @ {}:{} due to {}: {} " ,
788792 retrySignal .totalRetries () + 1 ,
789793 cfFile .getFileName (), modInfo .getName (), cfFile .getDisplayName (),
790- retrySignal .failure ().getClass ().getSimpleName ()
794+ retrySignal .failure ().getClass ().getSimpleName (),
795+ retrySignal .failure ().getMessage ()
791796 )
792797 )
793798 );
0 commit comments