Chunk DNS lookups as well

This commit is contained in:
Niklas Keller
2016-06-28 22:05:36 +02:00
parent e9d2a59eca
commit 74b275cf07

View File

@@ -174,16 +174,24 @@ class Issue implements Command {
}
private function checkDnsRecords($domains) {
$errors = [];
$domainChunks = array_chunk($domains, 10, true);
foreach ($domainChunks as $domainChunk) {
$promises = [];
foreach ($domains as $domain) {
foreach ($domainChunk as $domain) {
$promises[$domain] = \Amp\Dns\resolve($domain, [
"types" => [Record::A],
"hosts" => false,
]);
}
list($errors) = (yield \Amp\any($promises));
list($chunkErrors) = (yield \Amp\any($promises));
$errors += $chunkErrors;
}
if (!empty($errors)) {
throw new AcmeException("Couldn't resolve the following domains to an IPv4 record: " . implode(", ", array_keys($errors)));