Skip to content

Commit 1df9451

Browse files
min 2
1 parent 30e3501 commit 1df9451

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/lib/mongoose.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ export async function connectToDatabase() {
2121
return cached.conn;
2222
}
2323
if (cached && !cached.promise) {
24-
const opts = {
24+
25+
cached.promise = mongoose.connect(MONGODB_URI, {
26+
maxConnecting: 2,
2527
bufferCommands: false,
26-
maxConnectionPoolSize: 100,
27-
};
28-
cached.promise = mongoose.connect(MONGODB_URI, opts).then((mongoose) => {
28+
}).then((mongoose) => {
2929
return mongoose;
3030
});
3131
}

0 commit comments

Comments
 (0)