File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
Expand file tree Collapse file tree 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 {
172172 if (dryRun ) {
173173 return ;
174174 }
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+ }
177194 }
178195
179196 void verifyChecksums (String checksum ) throws Exception {
You can’t perform that action at this time.
0 commit comments