瀏覽代碼

Merge pull request #2397 from smaftoul/patch-1

Retry on some 5xx errors
Jordi Boggiano 11 年之前
父節點
當前提交
e243b4edd1
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Composer/Downloader/FileDownloader.php

+ 1 - 1
src/Composer/Downloader/FileDownloader.php

@@ -120,7 +120,7 @@ class FileDownloader implements DownloaderInterface
                             break;
                         } catch (TransportException $e) {
                             // if we got an http response with a proper code, then requesting again will probably not help, abort
-                            if ((0 !== $e->getCode() && 500 !== $e->getCode()) || !$retries) {
+                            if ((0 !== $e->getCode() && !in_array($e->getCode(),array(500, 502, 503, 504))) || !$retries) {
                                 throw $e;
                             }
                             if ($this->io->isVerbose()) {