Skip to content

Commit

Permalink
Retry failed downloads once
Browse files Browse the repository at this point in the history
  • Loading branch information
Berdir committed Aug 29, 2019
1 parent 1d89dcc commit 52e1eee
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Patches.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,14 @@ protected function getAndApplyPatch(RemoteFilesystem $downloader, $install_path,

// Download file from remote filesystem to this location.
$hostname = parse_url($patch_url, PHP_URL_HOST);
$downloader->copy($hostname, $patch_url, $filename, FALSE);

try {
$downloader->copy($hostname, $patch_url, $filename, false);
} catch (\Exception $e) {
// In case of an exception, retry once as the download might
// have failed due to intermittent network issues.
$downloader->copy($hostname, $patch_url, $filename, false);
}
}

// The order here is intentional. p1 is most likely to apply with git apply.
Expand Down

0 comments on commit 52e1eee

Please sign in to comment.