diff --git a/src/fetcher/activitypub.js b/src/fetcher/activitypub.js index 8809b57..7a470f4 100644 --- a/src/fetcher/activitypub.js +++ b/src/fetcher/activitypub.js @@ -89,8 +89,7 @@ export async function fn (data, opts) { })() }) - return Promise.race([fetchPromise, timeoutPromise]).then((result) => { + return Promise.race([fetchPromise, timeoutPromise]).finally(() => { clearTimeout(timeoutHandle) - return result }) } diff --git a/src/fetcher/aspe.js b/src/fetcher/aspe.js index 14c0bc1..4775db1 100644 --- a/src/fetcher/aspe.js +++ b/src/fetcher/aspe.js @@ -70,8 +70,7 @@ export async function fn (data, opts) { }) }) - return Promise.race([fetchPromise, timeoutPromise]).then((result) => { + return Promise.race([fetchPromise, timeoutPromise]).finally(() => { clearTimeout(timeoutHandle) - return result }) } diff --git a/src/fetcher/dns.js b/src/fetcher/dns.js index 1cd53a7..2c5eecd 100644 --- a/src/fetcher/dns.js +++ b/src/fetcher/dns.js @@ -56,8 +56,7 @@ export async function fn (data, opts) { }) }) - return Promise.race([fetchPromise, timeoutPromise]).then((result) => { + return Promise.race([fetchPromise, timeoutPromise]).finally(() => { clearTimeout(timeoutHandle) - return result }) } diff --git a/src/fetcher/graphql.js b/src/fetcher/graphql.js index a140916..15d544f 100644 --- a/src/fetcher/graphql.js +++ b/src/fetcher/graphql.js @@ -68,8 +68,7 @@ export async function fn (data, opts) { }) }) - return Promise.race([fetchPromise, timeoutPromise]).then((result) => { + return Promise.race([fetchPromise, timeoutPromise]).finally(() => { clearTimeout(timeoutHandle) - return result }) } diff --git a/src/fetcher/http.js b/src/fetcher/http.js index d18a93b..0421772 100644 --- a/src/fetcher/http.js +++ b/src/fetcher/http.js @@ -83,8 +83,7 @@ export async function fn (data, opts) { } }) - return Promise.race([fetchPromise, timeoutPromise]).then((result) => { + return Promise.race([fetchPromise, timeoutPromise]).finally(() => { clearTimeout(timeoutHandle) - return result }) } diff --git a/src/fetcher/irc.js b/src/fetcher/irc.js index 5c7aeb3..fa55200 100644 --- a/src/fetcher/irc.js +++ b/src/fetcher/irc.js @@ -80,8 +80,7 @@ export async function fn (data, opts) { } }) - return Promise.race([fetchPromise, timeoutPromise]).then((result) => { + return Promise.race([fetchPromise, timeoutPromise]).finally(() => { clearTimeout(timeoutHandle) - return result }) } diff --git a/src/fetcher/matrix.js b/src/fetcher/matrix.js index ab01711..0baf11d 100644 --- a/src/fetcher/matrix.js +++ b/src/fetcher/matrix.js @@ -72,8 +72,7 @@ export async function fn (data, opts) { }) }) - return Promise.race([fetchPromise, timeoutPromise]).then((result) => { + return Promise.race([fetchPromise, timeoutPromise]).finally(() => { clearTimeout(timeoutHandle) - return result }) } diff --git a/src/fetcher/openpgp.js b/src/fetcher/openpgp.js index f28c929..982a477 100644 --- a/src/fetcher/openpgp.js +++ b/src/fetcher/openpgp.js @@ -104,8 +104,7 @@ export async function fn (data, opts) { } }) - return Promise.race([fetchPromise, timeoutPromise]).then((result) => { + return Promise.race([fetchPromise, timeoutPromise]).finally(() => { clearTimeout(timeoutHandle) - return result }) } diff --git a/src/fetcher/telegram.js b/src/fetcher/telegram.js index 4d3e011..00fe7f1 100644 --- a/src/fetcher/telegram.js +++ b/src/fetcher/telegram.js @@ -99,8 +99,7 @@ export async function fn (data, opts) { }) }) - return Promise.race([fetchPromise, timeoutPromise]).then((result) => { + return Promise.race([fetchPromise, timeoutPromise]).finally(() => { clearTimeout(timeoutHandle) - return result }) } diff --git a/src/fetcher/xmpp.js b/src/fetcher/xmpp.js index 01cc5c6..88a0d2d 100644 --- a/src/fetcher/xmpp.js +++ b/src/fetcher/xmpp.js @@ -176,8 +176,7 @@ export async function fn (data, opts) { })() }) - return Promise.race([fetchPromise, timeoutPromise]).then((result) => { + return Promise.race([fetchPromise, timeoutPromise]).finally(() => { clearTimeout(timeoutHandle) - return result }) }