diff --git a/lib/fediblock.js b/lib/fediblock.js index 6d894bb..195f517 100644 --- a/lib/fediblock.js +++ b/lib/fediblock.js @@ -18,16 +18,17 @@ module.exports = async (client, apex, app) => { } }, requestPart = async uri => { - const ac = new AbortController() - setTimeout(() => { - ac.abort() - }, constant.abort_timeout) + const ac = new AbortController(), + timeout = setTimeout(() => { + ac.abort() + }, constant.abort_timeout) const response = await fetch(uri, { headers: { 'User-Agent': constant.agent }, signal: ac.signal, keepalive: false, timeout: constant.timeout, }) + clearTimeout(timeout) return await response.json() }, scanInstance = async instance => {