Fail hard only after 3 failed attempts
parent
c7ed20e9d8
commit
2c4c5dd764
|
@ -483,26 +483,27 @@ class ComposerRepository extends ArrayRepository implements StreamableRepository
|
||||||
|
|
||||||
break;
|
break;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
if ($retries) {
|
||||||
|
usleep(100);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ($e instanceof RepositorySecurityException) {
|
if ($e instanceof RepositorySecurityException) {
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$retries) {
|
if ($contents = $this->cache->read($cacheKey)) {
|
||||||
if ($contents = $this->cache->read($cacheKey)) {
|
if (!$this->degradedMode) {
|
||||||
if (!$this->degradedMode) {
|
$this->io->write('<warning>'.$e->getMessage().'</warning>');
|
||||||
$this->io->write('<warning>'.$e->getMessage().'</warning>');
|
$this->io->write('<warning>'.$this->url.' could not be fully loaded, package information was loaded from the local cache and may be out of date</warning>');
|
||||||
$this->io->write('<warning>'.$this->url.' could not be fully loaded, package information was loaded from the local cache and may be out of date</warning>');
|
|
||||||
}
|
|
||||||
$this->degradedMode = true;
|
|
||||||
$data = JsonFile::parseJson($contents, $this->cache->getRoot().$cacheKey);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
$this->degradedMode = true;
|
||||||
|
$data = JsonFile::parseJson($contents, $this->cache->getRoot().$cacheKey);
|
||||||
|
|
||||||
throw $e;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
usleep(100);
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue