Perf: drop stream transform for certain cases

This commit is contained in:
SukkaW
2026-09-02 16:32:29 +08:00
parent 3aa294acd9
commit 2647e5d0ed
7 changed files with 173 additions and 84 deletions

View File

@@ -1,12 +1,12 @@
import { fetchRemoteTextByLine } from './lib/fetch-text-by-line';
import { fetchRemoteTextLines } from './lib/fetch-text-by-line';
import { SpanCategory, task } from './trace';
import { IPListOutput } from './lib/rules/ip';
import { createFileDescription } from './constants/description';
const getChnCidrPromise = Promise.all([
fetchRemoteTextByLine('https://chnroutes2.cdn.skk.moe/chnroutes.txt', true).then(Array.fromAsync<string>),
fetchRemoteTextByLine('https://gaoyifan.github.io/china-operator-ip/china6.txt', true).then(Array.fromAsync<string>)
fetchRemoteTextLines('https://chnroutes2.cdn.skk.moe/chnroutes.txt', true),
fetchRemoteTextLines('https://gaoyifan.github.io/china-operator-ip/china6.txt', true)
]);
export const buildChnCidr = task(require.main === module, __filename)(async (span) => {