Graceful Shutdown & Production Deployment ကို validation, least privilege, structured errors/logs, health checks, timeouts, tests နဲ့ graceful shutdown တို့ပါသော production boundary အဖြစ်တည်ဆောက်ပါ။ Secrets မ log ဘဲ supported LTS ကို security patch များနှင့်အတူသုံးပါ။
ပိုပြီးနားလည်ထားရမယ့် အချက်
Graceful Shutdown & Production Deployment ကို validation, least privilege, structured errors/logs, health checks, timeouts, tests နဲ့ graceful shutdown တို့ပါသော production boundary အဖြစ်တည်ဆောက်ပါ။ Secrets မ log ဘဲ supported LTS ကို security patch များနှင့်အတူသုံးပါ။
လက်တွေ့အသုံးချမှု
Graceful Shutdown & Production Deployment example ကို concurrent requests, malformed input, timeout, cancellation, missing config, dependency failure နဲ့ shutdown cases ဖြင့်စမ်းပါ။ Blocking I/O, leaked handles နဲ့ unhandled rejection ရှိမရှိစစ်ပါ။
ဒီသင်ခန်းစာပြီးရင်
const server = app.listen(process.env.PORT ?? 3000);
async function shutdown(signal) {
console.log({ signal, message: 'draining' });
server.close(async () => { await database.close(); process.exit(0); });
setTimeout(() => process.exit(1), 10_000).unref();
}
process.once('SIGTERM', shutdown); process.once('SIGINT', shutdown);Exit မလုပ်မီ requests နဲ့ dependencies များကိုသန့်ရှင်းစွာပိတ်မည်။ကိုယ်တိုင်စမ်းကြည့်ရန်
Graceful Shutdown & Production Deployment example ကို concurrent requests, malformed input, timeout, cancellation, missing config, dependency failure နဲ့ shutdown cases ဖြင့်စမ်းပါ။ Blocking I/O, leaked handles နဲ့ unhandled rejection ရှိမရှိစစ်ပါ။
Runtime သတိပေးချက်
Local happy path မှန်ရုံဖြင့် concurrency, timeout, security နဲ့ shutdown paths မှန်ပြီဟုယူဆခြင်း။
Node.js API Documentation — Node.js