Fix version 1.7.4
## no issue
This commit is contained in:
@@ -45,9 +45,10 @@ async function gracefulShutdown(): Promise<void> {
|
|||||||
console.log("[Prisma] Semua koneksi ditutup");
|
console.log("[Prisma] Semua koneksi ditutup");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register shutdown handlers (hanya di environment Node.js)
|
// Register shutdown handlers (hanya di environment Node.js server)
|
||||||
// Cegah duplikasi listener dengan cek listenerCount terlebih dahulu
|
// Cegah duplikasi listener dengan cek listenerCount terlebih dahulu
|
||||||
if (typeof process !== "undefined") {
|
// IMPORTANT: Bungkus dalam check untuk mencegah error di browser
|
||||||
|
if (typeof process !== "undefined" && typeof process.listenerCount === "function") {
|
||||||
if (process.listenerCount("SIGINT") === 0) {
|
if (process.listenerCount("SIGINT") === 0) {
|
||||||
process.on("SIGINT", gracefulShutdown);
|
process.on("SIGINT", gracefulShutdown);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user