setImmediate in
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
ale 2024-09-29 10:14:03 +02:00
parent 2430ddcb8c
commit 43026021f5

View File

@ -19,7 +19,7 @@ module.exports = async (client, apex, app) => {
requestPart = async uri => { requestPart = async uri => {
const ac = new AbortController(), const ac = new AbortController(),
timeout = setTimeout(() => { timeout = setTimeout(() => {
ac.abort() setImmediate(() => ac.abort())
}, constant.abort_timeout), }, constant.abort_timeout),
response = await fetch(uri, { response = await fetch(uri, {
headers: { 'User-Agent': constant.agent }, headers: { 'User-Agent': constant.agent },
@ -27,7 +27,7 @@ module.exports = async (client, apex, app) => {
keepalive: false, keepalive: false,
timeout: constant.timeout, timeout: constant.timeout,
}) })
setImmediate(clearTimeout(timeout)) setImmediate(() => clearTimeout(timeout))
return await response.json() return await response.json()
}, },
scanInstance = async instance => { scanInstance = async instance => {