@itdigitalwing/aladdin-common 1.0.288 → 1.0.290
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -30,14 +30,15 @@ function connectToMongoDB() {
|
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
32
|
try {
|
|
33
|
-
// Create and connect the client only if not already connected
|
|
34
33
|
mongoClient = new MongoClient(MONGO_URI, {
|
|
35
|
-
useNewUrlParser
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
// ✅ removed useNewUrlParser and useUnifiedTopology
|
|
35
|
+
maxPoolSize: 10,
|
|
36
|
+
serverSelectionTimeoutMS: 30000,
|
|
37
|
+
connectTimeoutMS: 10000,
|
|
38
|
+
retryWrites: true, // ✅ add this
|
|
38
39
|
});
|
|
39
40
|
yield mongoClient.connect();
|
|
40
|
-
console.log("Connected to MongoDB with a single instance");
|
|
41
|
+
console.log("✅ Connected to MongoDB with a single instance");
|
|
41
42
|
return mongoClient;
|
|
42
43
|
}
|
|
43
44
|
catch (err) {
|