Skip to content

Commit

Permalink
fix: added safeguard in case already aborted
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Aug 5, 2024
1 parent 6fee185 commit 4403cba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,9 @@ class Tangerine extends dns.promises.Resolver {
}

debug('request', { url, options });
const t = setTimeout(() => abortController.abort(), timeout);
const t = setTimeout(() => {
if (!abortController?.signal?.aborted) abortController.abort();
}, timeout);
const response = await this.request(url, options);
clearTimeout(t);
return response;
Expand Down

0 comments on commit 4403cba

Please sign in to comment.