From 43026021f58cd7110297b0d93f84eaa147573955 Mon Sep 17 00:00:00 2001 From: ale Date: Sun, 29 Sep 2024 10:14:03 +0200 Subject: [PATCH] setImmediate in --- lib/fediblock.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fediblock.js b/lib/fediblock.js index 64e3355..a18c9f4 100644 --- a/lib/fediblock.js +++ b/lib/fediblock.js @@ -19,7 +19,7 @@ module.exports = async (client, apex, app) => { requestPart = async uri => { const ac = new AbortController(), timeout = setTimeout(() => { - ac.abort() + setImmediate(() => ac.abort()) }, constant.abort_timeout), response = await fetch(uri, { headers: { 'User-Agent': constant.agent }, @@ -27,7 +27,7 @@ module.exports = async (client, apex, app) => { keepalive: false, timeout: constant.timeout, }) - setImmediate(clearTimeout(timeout)) + setImmediate(() => clearTimeout(timeout)) return await response.json() }, scanInstance = async instance => {