Fixes #3445: Close timers after resolving/erroring the `dns.*` promises

main
Sergii Bondarenko 4 years ago
parent 33fbfb9a3c
commit 07a6e2b5fe
No known key found for this signature in database
GPG Key ID: 242150A50CD96A36

@ -637,17 +637,16 @@ class Site {
// DNS
if (!this.dns.length) {
const records = {}
const resolve = async (func, hostname) => {
try {
return await this.promiseTimeout(func(hostname))
} catch (error) {
if (error.code !== 'ENODATA') {
this.error(error)
}
return this.promiseTimeout(
func(hostname).catch((error) => {
if (error.code !== 'ENODATA') {
this.error(error)
}
return []
}
return []
})
)
}
const domain = url.hostname.replace(/^www\./, '')

Loading…
Cancel
Save