Refactor: rework tracer

This commit is contained in:
SukkaW
2024-06-08 18:02:39 +08:00
parent f5863d82d1
commit 9a0113bf69
23 changed files with 51 additions and 142 deletions

View File

@@ -13,7 +13,7 @@ export const getChnCidrPromise = createMemoizedPromise(async () => {
return exclude([...cidr, ...CN_CIDR_NOT_INCLUDED_IN_CHNROUTE], NON_CN_CIDR_INCLUDED_IN_CHNROUTE, true);
});
export const buildChnCidr = task(import.meta.path, async (span) => {
export const buildChnCidr = task(import.meta.main, import.meta.path)(async (span) => {
const filteredCidr = await span.traceChildAsync('download chnroutes2', getChnCidrPromise);
// Can not use SHARED_DESCRIPTION here as different license
@@ -49,7 +49,3 @@ export const buildChnCidr = task(import.meta.path, async (span) => {
)
]);
});
if (import.meta.main) {
buildChnCidr();
}