diff --git a/src/Composer/Repository/ComposerRepository.php b/src/Composer/Repository/ComposerRepository.php index b4fb40f0c..985655d4a 100644 --- a/src/Composer/Repository/ComposerRepository.php +++ b/src/Composer/Repository/ComposerRepository.php @@ -483,26 +483,27 @@ class ComposerRepository extends ArrayRepository implements StreamableRepository break; } catch (\Exception $e) { + if ($retries) { + usleep(100); + continue; + } + if ($e instanceof RepositorySecurityException) { throw $e; } - if (!$retries) { - if ($contents = $this->cache->read($cacheKey)) { - if (!$this->degradedMode) { - $this->io->write(''.$e->getMessage().''); - $this->io->write(''.$this->url.' could not be fully loaded, package information was loaded from the local cache and may be out of date'); - } - $this->degradedMode = true; - $data = JsonFile::parseJson($contents, $this->cache->getRoot().$cacheKey); - - break; + if ($contents = $this->cache->read($cacheKey)) { + if (!$this->degradedMode) { + $this->io->write(''.$e->getMessage().''); + $this->io->write(''.$this->url.' could not be fully loaded, package information was loaded from the local cache and may be out of date'); } + $this->degradedMode = true; + $data = JsonFile::parseJson($contents, $this->cache->getRoot().$cacheKey); - throw $e; + break; } - usleep(100); + throw $e; } }