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

@@ -32,7 +32,7 @@ export const getTelegramCIDRPromise = createMemoizedPromise(async () => {
return { date, results };
});
export const buildTelegramCIDR = task(import.meta.path, async (span) => {
export const buildTelegramCIDR = task(import.meta.main, import.meta.path)(async (span) => {
const { date, results } = await span.traceChildAsync('get telegram cidr', getTelegramCIDRPromise);
if (results.length === 0) {
@@ -56,7 +56,3 @@ export const buildTelegramCIDR = task(import.meta.path, async (span) => {
path.resolve(import.meta.dir, '../Clash/ip/telegram.txt')
);
});
if (import.meta.main) {
buildTelegramCIDR();
}