server/14-apr-26 #69

Merged
bagasbanuna merged 17 commits from server/14-apr-26 into staging 2026-04-14 16:38:23 +08:00
34 changed files with 363 additions and 1906 deletions
Showing only changes of commit a71997b4ef - Show all commits

View File

@@ -45,9 +45,10 @@ async function gracefulShutdown(): Promise<void> {
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
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) {
process.on("SIGINT", gracefulShutdown);
}