File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -364,6 +364,22 @@ pool.on('enqueue', function () {
364
364
});
365
365
```
366
366
367
+ ## Closing all the connections in a pool
368
+
369
+ When you are done using the pool, you have to end all the connections or your
370
+ script will hang until the db server closes them. To end all the connections
371
+ in the pool, use the ` end ` method on the pool:
372
+
373
+ ``` js
374
+ pool .end (function (err ) {
375
+ // all connections in the pool have ended
376
+ });
377
+ ```
378
+
379
+ The ` end ` method takes an _ optional_ callback that you can use to know once
380
+ all the connections have ended. The connections end _ gracefully_ , so all
381
+ pending queries will still complete and the time to end the pool will vary.
382
+
367
383
## PoolCluster
368
384
369
385
PoolCluster provides multiple hosts connection. (group & retry & selector)
You can’t perform that action at this time.
0 commit comments