We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 30e3501 commit 1df9451Copy full SHA for 1df9451
1 file changed
src/lib/mongoose.ts
@@ -21,11 +21,11 @@ export async function connectToDatabase() {
21
return cached.conn;
22
}
23
if (cached && !cached.promise) {
24
- const opts = {
+
25
+ cached.promise = mongoose.connect(MONGODB_URI, {
26
+ maxConnecting: 2,
27
bufferCommands: false,
- maxConnectionPoolSize: 100,
- };
28
- cached.promise = mongoose.connect(MONGODB_URI, opts).then((mongoose) => {
+ }).then((mongoose) => {
29
return mongoose;
30
});
31
0 commit comments