Housekeeping & Update Reject Hosts

This commit is contained in:
SukkaW
2024-10-16 00:12:40 +08:00
parent c5ee4bad53
commit 3651999afb
7 changed files with 105 additions and 125 deletions

View File

@@ -1,6 +1,5 @@
import { basename, extname } from 'node:path';
import picocolors from 'picocolors';
import wtf from 'wtfnode';
const SPAN_STATUS_START = 0;
const SPAN_STATUS_END = 1;
@@ -103,11 +102,10 @@ export function task(importMetaMain: boolean, importMetaPath: string) {
const dummySpan = createSpan(taskName);
if (importMetaMain) {
fn(dummySpan).finally(() => {
dummySpan.traceChildAsync('dummy', fn).finally(() => {
dummySpan.stop();
printTraceResult(dummySpan.traceResult);
console.log(wtf.dump());
whyIsNodeRunning();
});
}
@@ -120,6 +118,11 @@ export function task(importMetaMain: boolean, importMetaPath: string) {
};
}
export async function whyIsNodeRunning() {
const mod = await import('why-is-node-running');
return mod.default();
}
// const isSpan = (obj: any): obj is Span => {
// return typeof obj === 'object' && obj && spanTag in obj;
// };