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 7eda09d commit 70528c8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Plugin/Patches.php
Expand Up @@ -382,7 +382,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);
}
}

// Modified from drush6:make.project.inc
Expand Down

0 comments on commit 70528c8

Please sign in to comment.