Skip to content

Commit 4403cba

Browse files
committed
fix: added safeguard in case already aborted
1 parent 6fee185 commit 4403cba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,9 @@ class Tangerine extends dns.promises.Resolver {
10721072
}
10731073

10741074
debug('request', { url, options });
1075-
const t = setTimeout(() => abortController.abort(), timeout);
1075+
const t = setTimeout(() => {
1076+
if (!abortController?.signal?.aborted) abortController.abort();
1077+
}, timeout);
10761078
const response = await this.request(url, options);
10771079
clearTimeout(t);
10781080
return response;

0 commit comments

Comments
 (0)