refactor(server): config system (#11081)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { INestApplicationContext, LogLevel } from '@nestjs/common';
|
||||
import { ModuleRef } from '@nestjs/core';
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
import whywhywhy from 'why-is-node-running';
|
||||
|
||||
import { RefreshFeatures0001 } from '../../data/migrations/0001-refresh-features';
|
||||
|
||||
@@ -32,3 +33,21 @@ export async function initTestingDB(context: INestApplicationContext) {
|
||||
export async function sleep(ms: number) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
export function debugProcessHolding(ignorePrismaStack = true) {
|
||||
setImmediate(() => {
|
||||
whywhywhy({
|
||||
error: message => {
|
||||
// ignore prisma error
|
||||
if (
|
||||
ignorePrismaStack &&
|
||||
(message.includes('Prisma') || message.includes('prisma'))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.error(message);
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user