Chore/Perf: fetch enable HTTP/2

This commit is contained in:
SukkaW
2024-10-08 19:50:31 +08:00
parent 92985a409d
commit de9429ce92
7 changed files with 31 additions and 7 deletions

View File

@@ -2,6 +2,10 @@ import retry from 'async-retry';
import picocolors from 'picocolors';
import { setTimeout } from 'node:timers/promises';
import { setGlobalDispatcher, Agent } from 'undici';
setGlobalDispatcher(new Agent({ allowH2: true }));
function isClientError(err: unknown): err is NodeJS.ErrnoException {
if (!err || typeof err !== 'object') return false;