Perf: speed up public folder setup / remove unused mkdir call

This commit is contained in:
SukkaW
2023-12-19 23:08:28 +08:00
parent 74293ac2f8
commit 38be4ab0c6
5 changed files with 31 additions and 38 deletions

View File

@@ -1,7 +1,6 @@
import { fetchRemoteTextAndReadByLine } from './lib/fetch-text-by-line';
import { processLineFromReadline } from './lib/process-line';
import path from 'path';
import fsp from 'fs/promises';
import { task } from './lib/trace-runner';
import { exclude, merge } from 'fast-cidr-tools';
@@ -27,10 +26,7 @@ const RESERVED_IPV4_CIDR = [
];
export const buildInternalReverseChnCIDR = task(import.meta.path, async () => {
const cidr = (await Promise.all([
processLineFromReadline(await fetchRemoteTextAndReadByLine('https://raw.githubusercontent.com/misakaio/chnroutes2/master/chnroutes.txt')),
fsp.mkdir(path.resolve(import.meta.dir, '../List/internal'), { recursive: true })
]))[0];
const cidr = await processLineFromReadline(await fetchRemoteTextAndReadByLine('https://raw.githubusercontent.com/misakaio/chnroutes2/master/chnroutes.txt'));
const reversedCidr = merge(
exclude(