mirror of
https://github.com/jarvis2f/vortex.git
synced 2024-11-16 11:42:24 +08:00
Ignore pino the worker has exited
error.
This commit is contained in:
parent
4cda6e3faf
commit
0f0f692c90
|
@ -3,7 +3,11 @@ import pino, { type Logger } from "pino";
|
|||
import "pino-abstract-transport";
|
||||
|
||||
const targets = [];
|
||||
|
||||
targets.push({
|
||||
target: path.join(process.cwd(), "./src/lib/pino-prisma.mjs"),
|
||||
options: {},
|
||||
level: "trace",
|
||||
});
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
// targets.push({
|
||||
// target: 'pino/file',
|
||||
|
@ -12,11 +16,6 @@ if (process.env.NODE_ENV === "production") {
|
|||
// },
|
||||
// level: 'trace',
|
||||
// })
|
||||
targets.push({
|
||||
target: path.join(process.cwd(), "./src/lib/pino-prisma.mjs"),
|
||||
options: {},
|
||||
level: "trace",
|
||||
});
|
||||
} else {
|
||||
targets.push({
|
||||
target: "pino-pretty",
|
||||
|
@ -36,6 +35,9 @@ const logger: Logger = pino({
|
|||
});
|
||||
|
||||
process.on("uncaughtException", (err) => {
|
||||
if (err.message === "the worker has exited") {
|
||||
return;
|
||||
}
|
||||
console.error(err);
|
||||
if (logger) logger.fatal(err, "uncaught exception detected");
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user