mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 19:07:08 +02:00
testing without setGlobalDispatcher
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user