Chunk authorization requests into groups of 10
This commit is contained in:
@@ -80,14 +80,22 @@ class Issue implements Command {
|
|||||||
$this->climate->br();
|
$this->climate->br();
|
||||||
|
|
||||||
$acme = $this->acmeFactory->build($server, $keyPair);
|
$acme = $this->acmeFactory->build($server, $keyPair);
|
||||||
$promises = [];
|
$errors = [];
|
||||||
|
|
||||||
foreach ($domains as $i => $domain) {
|
$domainChunks = array_chunk($domains, 10, true);
|
||||||
$promises[] = \Amp\resolve($this->solveChallenge($acme, $keyPair, $domain, $docRoots[$i]));
|
|
||||||
|
foreach ($domainChunks as $domainChunk) {
|
||||||
|
$promises = [];
|
||||||
|
|
||||||
|
foreach ($domainChunk as $i => $domain) {
|
||||||
|
$promises[] = \Amp\resolve($this->solveChallenge($acme, $keyPair, $domain, $docRoots[$i]));
|
||||||
|
}
|
||||||
|
|
||||||
|
list($chunkErrors) = (yield \Amp\any($promises));
|
||||||
|
|
||||||
|
$errors += $chunkErrors;
|
||||||
}
|
}
|
||||||
|
|
||||||
list($errors) = (yield \Amp\any($promises));
|
|
||||||
|
|
||||||
if (!empty($errors)) {
|
if (!empty($errors)) {
|
||||||
foreach ($errors as $error) {
|
foreach ($errors as $error) {
|
||||||
$this->climate->error($error->getMessage());
|
$this->climate->error($error->getMessage());
|
||||||
|
|||||||
Reference in New Issue
Block a user