mirror of
https://github.com/rife2/bld
synced 2026-08-05 07:07:48 +02:00
Compare commits
No commits in common. "df667743381490bc16a2d6f3171d61cbac37f300" and "42bd25dd1cda115d0ab4f0709818e694960dc595" have entirely different histories.
df66774338
...
42bd25dd1c
2
core
2
core
|
|
@ -1 +1 @@
|
||||||
Subproject commit daa5a12437feaa4e3d69dea1385a44f7eaeccf0a
|
Subproject commit 51b3fa3cb6f6cef2e705ee805f704c11c45e7c41
|
||||||
|
|
@ -20,8 +20,6 @@ import rife.tools.FileUtils;
|
||||||
import rife.tools.exceptions.FileUtilsErrorException;
|
import rife.tools.exceptions.FileUtilsErrorException;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
@ -39,33 +37,9 @@ public class TestPublishOperation {
|
||||||
throws Exception {
|
throws Exception {
|
||||||
reposiliteJar_ = File.createTempFile("reposilite", "jar");
|
reposiliteJar_ = File.createTempFile("reposilite", "jar");
|
||||||
reposiliteJar_.deleteOnExit();
|
reposiliteJar_.deleteOnExit();
|
||||||
var url = "https://maven.reposilite.com/releases/com/reposilite/reposilite/3.4.0/reposilite-3.4.0-all.jar";
|
System.out.print("Downloading: https://maven.reposilite.com/releases/com/reposilite/reposilite/3.4.0/reposilite-3.4.0-all.jar ...");
|
||||||
System.out.print("Downloading: " + url + " ...");
|
|
||||||
System.out.flush();
|
System.out.flush();
|
||||||
|
FileUtils.copy(new URL("https://maven.reposilite.com/releases/com/reposilite/reposilite/3.4.0/reposilite-3.4.0-all.jar").openStream(), reposiliteJar_);
|
||||||
// the reposilite CDN intermittently rate-limits with a 403 when
|
|
||||||
// several matrix jobs download at the same time, retry with a
|
|
||||||
// backoff before giving up
|
|
||||||
var attempts = 5;
|
|
||||||
for (var attempt = 1; ; ++attempt) {
|
|
||||||
try {
|
|
||||||
var connection = (HttpURLConnection) new URL(url).openConnection();
|
|
||||||
connection.setRequestProperty("User-Agent", "bld-tests");
|
|
||||||
connection.setConnectTimeout(30_000);
|
|
||||||
connection.setReadTimeout(60_000);
|
|
||||||
try (var input = connection.getInputStream()) {
|
|
||||||
FileUtils.copy(input, reposiliteJar_);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
} catch (IOException e) {
|
|
||||||
if (attempt >= attempts) {
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
System.out.print(" retrying (" + e.getMessage() + ") ...");
|
|
||||||
System.out.flush();
|
|
||||||
Thread.sleep(attempt * 3_000L);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
System.out.println("done");
|
System.out.println("done");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue