Skip to content

Commit 6f523c4

Browse files
committed
update connection settings
1 parent 02d48cf commit 6f523c4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/user-vault/providers/databaseProviders.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,17 @@ async function tenantConnection(tenantDB, uri) {
3535

3636
if (!foundConn) {
3737
if (!connectionPromises[tenantDB]) {
38-
connectionPromises[tenantDB] = mongoose.createConnection(uri).asPromise();
38+
connectionPromises[tenantDB] = mongoose
39+
.createConnection(uri, {
40+
maxConnecting: 10,
41+
maxPoolSize: 100,
42+
maxStalenessSeconds: 100,
43+
maxIdleTimeMS: 500000,
44+
serverSelectionTimeoutMS: 500000,
45+
socketTimeoutMS: 500000,
46+
connectTimeoutMS: 500000,
47+
})
48+
.asPromise();
3949
}
4050

4151
const newConnection = await connectionPromises[tenantDB];

0 commit comments

Comments
 (0)