mirror of
https://github.com/SukkaW/Surge.git
synced 2026-04-29 17:36:56 +08:00
Update CDN & Download Hosts
This commit is contained in:
@@ -97,7 +97,7 @@ export function createSpan(name: string, parentTraceResult?: TraceResult): Span
|
|||||||
return span;
|
return span;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const dummySpan = createSpan('');
|
export const dummySpan = createSpan('dummy');
|
||||||
|
|
||||||
export function task(importMetaMain: boolean, importMetaPath: string) {
|
export function task(importMetaMain: boolean, importMetaPath: string) {
|
||||||
return <T>(fn: (span: Span, onCleanup: (cb: () => Promise<void> | void) => void) => Promise<T>, customName?: string) => {
|
return <T>(fn: (span: Span, onCleanup: (cb: () => Promise<void> | void) => void) => Promise<T>, customName?: string) => {
|
||||||
@@ -107,7 +107,7 @@ export function task(importMetaMain: boolean, importMetaPath: string) {
|
|||||||
cleanup = cb;
|
cleanup = cb;
|
||||||
};
|
};
|
||||||
|
|
||||||
const dummySpan = createSpan(taskName);
|
const innerSpan = createSpan(taskName);
|
||||||
if (importMetaMain) {
|
if (importMetaMain) {
|
||||||
process.on('uncaughtException', (error) => {
|
process.on('uncaughtException', (error) => {
|
||||||
console.error('Uncaught exception:', error);
|
console.error('Uncaught exception:', error);
|
||||||
@@ -118,20 +118,24 @@ export function task(importMetaMain: boolean, importMetaPath: string) {
|
|||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
dummySpan.traceChildAsync('dummy', (childSpan) => fn(childSpan, onCleanup)).finally(() => {
|
innerSpan.traceChildAsync('dummy', (childSpan) => fn(childSpan, onCleanup)).finally(() => {
|
||||||
dummySpan.stop();
|
innerSpan.stop();
|
||||||
printTraceResult(dummySpan.traceResult);
|
printTraceResult(innerSpan.traceResult);
|
||||||
process.nextTick(whyIsNodeRunning);
|
process.nextTick(whyIsNodeRunning);
|
||||||
process.nextTick(() => process.exit(0));
|
process.nextTick(() => process.exit(0));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return async (span?: Span) => {
|
function run(span?: Span | null): Promise<T> {
|
||||||
if (span) {
|
return fn(span || innerSpan, onCleanup).finally(() => {
|
||||||
return span.traceChildAsync(taskName, (childSpan) => fn(childSpan, onCleanup).finally(() => cleanup()));
|
(span || innerSpan).stop();
|
||||||
}
|
cleanup();
|
||||||
return fn(dummySpan, onCleanup).finally(() => cleanup());
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
|
return Object.assign(run, {
|
||||||
|
getInternalTraceResult: () => innerSpan.traceResult
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2287,6 +2287,13 @@ widget.intercom.io
|
|||||||
.intercomcdn.io
|
.intercomcdn.io
|
||||||
.intercomassets.com
|
.intercomassets.com
|
||||||
|
|
||||||
|
# >> Garmin
|
||||||
|
fonts.garmin.com
|
||||||
|
static.garmin.com
|
||||||
|
share-assets.fe.garmin.com
|
||||||
|
res.garmin.com
|
||||||
|
.garmincdn.com
|
||||||
|
|
||||||
# >> Instant.Page
|
# >> Instant.Page
|
||||||
.instant.page
|
.instant.page
|
||||||
|
|
||||||
|
|||||||
@@ -614,6 +614,10 @@ cdnorg.d.miui.com
|
|||||||
# Cyber Duck
|
# Cyber Duck
|
||||||
update.cyberduck.io
|
update.cyberduck.io
|
||||||
version.cyberduck.io
|
version.cyberduck.io
|
||||||
|
# Garmin
|
||||||
|
download.garmin.com
|
||||||
|
worldwide.omtmapupdate.garmin.com
|
||||||
|
omtmapupdate.garmin.com
|
||||||
# Open Source Mirrors
|
# Open Source Mirrors
|
||||||
debian.unnoba.edu.ar
|
debian.unnoba.edu.ar
|
||||||
mirror.sitsa.com.ar
|
mirror.sitsa.com.ar
|
||||||
|
|||||||
Reference in New Issue
Block a user