Feat: implement parallel fetch w/ HTTP 304 (#43)

This commit is contained in:
Sukka
2024-10-09 20:49:36 +08:00
committed by GitHub
parent 07d3fdf05b
commit 2e48a72a3c
10 changed files with 273 additions and 111 deletions

View File

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