Skip to content

Commit

Permalink
Fixes #3445: Close timers after resolving/erroring the dns.* promises
Browse files Browse the repository at this point in the history
  • Loading branch information
BR0kEN- committed Oct 26, 2020
1 parent 33fbfb9 commit 07a6e2b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/drivers/npm/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -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\./, '')
Expand Down

0 comments on commit 07a6e2b

Please sign in to comment.