From 6903e9f3caa05dee706221f9aedd1bdb8856901a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sat, 11 Apr 2026 09:49:10 -0400 Subject: [PATCH] testing without setGlobalDispatcher --- src/request.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/request.js b/src/request.js index 852f525abd..daa207ca4a 100644 --- a/src/request.js +++ b/src/request.js @@ -1,7 +1,7 @@ 'use strict'; const dns = require('dns').promises; -const { Agent, setGlobalDispatcher } = require('undici'); +const { Agent } = require('undici'); const nconf = require('nconf'); const ipaddr = require('ipaddr.js'); const { CookieJar } = require('tough-cookie'); @@ -90,8 +90,6 @@ const dispatcher = new NodeBBAgent({ }, }); -setGlobalDispatcher(dispatcher); - async function call(url, method, { body, timeout, jar, ...config } = {}) { const { ok } = await check(url); if (!ok) { @@ -111,6 +109,7 @@ async function call(url, method, { body, timeout, jar, ...config } = {}) { 'user-agent': userAgent, ...config.headers, }, + dispatcher, }; if (timeout > 0) { opts.signal = AbortSignal.timeout(timeout);