mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-29 20:45:20 +00:00
Automated tool downloads are made more robust by using HTTP download retries.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@23122 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
25c3bcbf29
commit
fe086df945
1 file changed
+4
-1
@@ -58,6 +58,7 @@ import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.io.input.CountingInputStream;
|
||||
import org.apache.commons.fileupload.FileItem;
|
||||
import org.kohsuke.stapler.Stapler;
|
||||
import org.jvnet.robust_http_client.RetryableHttpStream;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
@@ -557,7 +558,9 @@ public final class FilePath implements Serializable {
|
||||
if(listener!=null)
|
||||
listener.getLogger().println(message);
|
||||
|
||||
CountingInputStream cis = new CountingInputStream(con.getInputStream());
|
||||
// for HTTP downloads, enable automatic retry for added resilience
|
||||
InputStream in = archive.getProtocol().equals("http") ? new RetryableHttpStream(archive) : con.getInputStream();
|
||||
CountingInputStream cis = new CountingInputStream(in);
|
||||
try {
|
||||
if(archive.toExternalForm().endsWith(".zip"))
|
||||
unzipFrom(cis);
|
||||
|
||||
Reference in new issue
Block a user