Skip to content

Commit

Permalink
Merge pull request #283 from Berdir/retry-download-1.x
Browse files Browse the repository at this point in the history
Retry failed downloads once
  • Loading branch information
cweagans committed Aug 29, 2019
2 parents 1d89dcc + 52e1eee commit 2e6f72a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Patches.php
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 2e6f72a

Please sign in to comment.