mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Perf: further speed up infra
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
// @ts-check
|
||||
const { fetch } = require('undici');
|
||||
const fetchWithRetry = /** @type {fetch} */(require('@vercel/fetch-retry')(fetch));
|
||||
const undici = require('undici');
|
||||
|
||||
// Enable HTTP/2 supports
|
||||
undici.setGlobalDispatcher(new undici.Agent({
|
||||
allowH2: true,
|
||||
pipelining: 10
|
||||
}));
|
||||
|
||||
const fetchWithRetry = /** @type {import('undici').fetch} */(require('@vercel/fetch-retry')(undici.fetch));
|
||||
module.exports.fetchWithRetry = fetchWithRetry;
|
||||
|
||||
Reference in New Issue
Block a user