*Ensure the dns module is ready before making a query
This commit is contained in:
parent
512b85aa55
commit
ffe6c9595e
|
@ -1,5 +1,8 @@
|
||||||
import NodeCache from "node-cache";
|
import NodeCache from "node-cache";
|
||||||
import { resolve as resolveDns } from "@lumeweb/kernel-dns-client";
|
import {
|
||||||
|
ready as dnsReady,
|
||||||
|
resolve as resolveDns,
|
||||||
|
} from "@lumeweb/kernel-dns-client";
|
||||||
import {
|
import {
|
||||||
DNS_RECORD_TYPE,
|
DNS_RECORD_TYPE,
|
||||||
DNSRecord,
|
DNSRecord,
|
||||||
|
@ -24,6 +27,8 @@ export async function resolve(
|
||||||
return cache.get(cacheId) as DNSResult;
|
return cache.get(cacheId) as DNSResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await dnsReady();
|
||||||
|
|
||||||
let res;
|
let res;
|
||||||
try {
|
try {
|
||||||
res = await resolveDns(domain, options, bypassCache);
|
res = await resolveDns(domain, options, bypassCache);
|
||||||
|
|
Reference in New Issue