Skip to content

Commit

Permalink
break
Browse files Browse the repository at this point in the history
  • Loading branch information
cubewhy committed Jan 6, 2024
1 parent 0165e97 commit 3f4e1c4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/org/cubewhy/celestial/files/Downloadable.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import lombok.SneakyThrows;

import java.io.File;
import java.io.IOException;
import java.net.URL;

public record Downloadable(URL url, File file, String sha1) implements Runnable {
Expand All @@ -22,7 +23,12 @@ public record Downloadable(URL url, File file, String sha1) implements Runnable
public void run() {
// TODO multipart support
for (int i = 0; i < fallBack; i++) {
DownloadManager.download(this.url, this.file, this.sha1);
try {
DownloadManager.download(this.url, this.file, this.sha1);
} catch (Exception e) {
continue; // try again
}
break; // no error
}
}
}

0 comments on commit 3f4e1c4

Please sign in to comment.