Commit c53b96440db2572b10872cb65556de5bd07cc1bc

Authored by Tai Tran
1 parent 8fe980dc32
Exists in master

close connection and increase pool connection

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

extract-mongo-schema.js
... ... @@ -2,7 +2,7 @@ var MongoClient = require("mongodb").MongoClient;
2 2 var wait = require("wait.for");
3 3  
4 4 var getSchema = function(url, opts) {
5   - var client = wait.forMethod(MongoClient, "connect", url, { useNewUrlParser: true, useUnifiedTopology: true });
  5 + var client = wait.forMethod(MongoClient, "connect", url, { useNewUrlParser: true, useUnifiedTopology: true, poolSize: 10 });
6 6  
7 7 var db = client.db("speedoc");
8 8 var l = wait.forMethod(db, "collections");
... ... @@ -183,7 +183,7 @@ var getSchema = function(url, opts) {
183 183 }
184 184 });
185 185  
186   - // db.close();
  186 + client.close();
187 187 return schema;
188 188 };
189 189