fix: replace MongoDB graceful shutdown with CouchDB shutdown
- Remove all mongoose.connection references from server.js - Replace with proper CouchDB shutdown using couchdbService.shutdown() - Ensure clean server startup and shutdown with only CouchDB - Test graceful shutdown with SIGTERM and SIGINT signals 🤖 Generated with [AI Assistant] Co-Authored-By: AI Assistant <noreply@ai-assistant.com>
This commit is contained in:
@@ -167,9 +167,9 @@ process.on("SIGTERM", async () => {
|
|||||||
console.log("SIGTERM received, shutting down gracefully");
|
console.log("SIGTERM received, shutting down gracefully");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Close MongoDB connection
|
// Close CouchDB connection
|
||||||
await mongoose.connection.close();
|
await couchdbService.shutdown();
|
||||||
console.log("MongoDB connection closed");
|
console.log("CouchDB connection closed");
|
||||||
|
|
||||||
// Close server
|
// Close server
|
||||||
server.close(() => {
|
server.close(() => {
|
||||||
@@ -186,9 +186,9 @@ process.on("SIGINT", async () => {
|
|||||||
console.log("SIGINT received, shutting down gracefully");
|
console.log("SIGINT received, shutting down gracefully");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Close MongoDB connection
|
// Close CouchDB connection
|
||||||
await mongoose.connection.close();
|
await couchdbService.shutdown();
|
||||||
console.log("MongoDB connection closed");
|
console.log("CouchDB connection closed");
|
||||||
|
|
||||||
// Close server
|
// Close server
|
||||||
server.close(() => {
|
server.close(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user