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:
William Valentin
2025-11-02 22:18:14 -08:00
parent 33a57a12e5
commit d9b7b78b0d

View File

@@ -167,9 +167,9 @@ process.on("SIGTERM", async () => {
console.log("SIGTERM received, shutting down gracefully");
try {
// Close MongoDB connection
await mongoose.connection.close();
console.log("MongoDB connection closed");
// Close CouchDB connection
await couchdbService.shutdown();
console.log("CouchDB connection closed");
// Close server
server.close(() => {
@@ -186,9 +186,9 @@ process.on("SIGINT", async () => {
console.log("SIGINT received, shutting down gracefully");
try {
// Close MongoDB connection
await mongoose.connection.close();
console.log("MongoDB connection closed");
// Close CouchDB connection
await couchdbService.shutdown();
console.log("CouchDB connection closed");
// Close server
server.close(() => {