Merge pull request #3446 from BR0kEN-/issues/3445

#3445: Close timers after resolving/erroring the `dns.*` promises
main
Elbert Alias 4 years ago committed by GitHub
commit 91f1ecbfc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save