Update CDN / Domestic / Global Hosts

This commit is contained in:
SukkaW
2024-02-03 21:15:09 +08:00
parent fd015d339b
commit 067d19f488
7 changed files with 25 additions and 7 deletions

View File

@@ -78,9 +78,6 @@ export function processHosts(span: Span, hostsUrl: string, mirrors: string[] | n
lineCb(l);
}
} else {
// Avoid event loop starvation, so we wait for a macrotask before we start fetching.
await Promise.resolve();
const filterRules = await childSpan
.traceChild('download hosts')
.traceAsyncFn(() => fetchAssets(hostsUrl, mirrors).then(text => text.split('\n')));
@@ -198,9 +195,6 @@ export async function processFilterRules(
lineCb(line);
}
} else {
// Avoid event loop starvation, so we wait for a macrotask before we start fetching.
await Promise.resolve();
const filterRules = await span.traceChild('download adguard filter').traceAsyncFn(() => {
return fetchAssets(filterRulesUrl, fallbackUrls).then(text => text.split('\n'));
});

View File

@@ -89,6 +89,7 @@ export const parseGfwList = async () => {
};
await Promise.all([
runAgainstRuleset(path.resolve(import.meta.dir, '../Source/non_ip/global.conf')),
runAgainstRuleset(path.resolve(import.meta.dir, '../Source/non_ip/global_plus.conf')),
runAgainstRuleset(path.resolve(import.meta.dir, '../List/non_ip/stream.conf'))
]);