Commit 3f680c6 1 parent ae53f17 commit 3f680c6 Copy full SHA for 3f680c6
File tree 1 file changed +19
-2
lines changed
1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -172,8 +172,25 @@ void downloadArchive(boolean dryRun) throws Exception {
172
172
if (dryRun ) {
173
173
return ;
174
174
}
175
- var response = browser .download (uri , archive );
176
- GitHub .debug (response .toString ());
175
+ int retry = 0 ;
176
+ while (true ) {
177
+ try {
178
+ GitHub .debug ("Downloading " + uri );
179
+ var response = browser .download (uri , archive );
180
+ GitHub .debug (response .toString ());
181
+ return ;
182
+ } catch (IOException exception ) {
183
+ var message = Optional .ofNullable (exception .getMessage ()).orElseGet (exception ::toString );
184
+ if (++retry == 3 ) {
185
+ GitHub .error ("Download failed due to: " + message );
186
+ throw exception ;
187
+ }
188
+ var seconds = retry * 10 ;
189
+ GitHub .warn (String .format ("Retrying in %d seconds due to: %s" , seconds , message ));
190
+ //noinspection BusyWait
191
+ Thread .sleep (seconds * 1000L );
192
+ }
193
+ }
177
194
}
178
195
179
196
void verifyChecksums (String checksum ) throws Exception {
You can’t perform that action at this time.
0 commit comments