Add request log and uncatch error tip. (#1531)

This commit is contained in:
Archer
2024-05-20 10:31:44 +08:00
committed by GitHub
parent e35ce2caa0
commit 8e8ceb7439
9 changed files with 50 additions and 31 deletions

View File

@@ -20,3 +20,15 @@ export const initFastGPTConfig = (config?: FastGPTConfigFileType) => {
global.whisperModel = config.whisperModel;
global.reRankModels = config.reRankModels;
};
export const systemStartCb = () => {
process.on('uncaughtException', (err) => {
console.error('Uncaught Exception:', err);
// process.exit(1); // 退出进程
});
process.on('unhandledRejection', (reason, promise) => {
console.error('Unhandled Rejection at:', promise, 'reason:', reason);
// process.exit(1); // 退出进程
});
};