Update Apple / Global / Reject Hosts

This commit is contained in:
SukkaW
2024-01-26 16:19:02 +08:00
parent f6dcbe8e6c
commit 7458d6ff86
6 changed files with 51 additions and 62 deletions

View File

@@ -80,9 +80,9 @@ export function processHosts(span: Span, hostsUrl: string, mirrors: string[] | n
// 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(() => {
return fetchAssets(hostsUrl, mirrors).then(text => text.split('\n'));
});
const filterRules = await childSpan
.traceChild('download hosts')
.traceAsyncFn(() => fetchAssets(hostsUrl, mirrors).then(text => text.split('\n')));
childSpan.traceChild('parse hosts').traceSyncFn(() => {
for (let i = 0, len = filterRules.length; i < len; i++) {