Skip to content

Commit a83efd6

Browse files
authored
Merge pull request #1455 from zbjornson/728-unref
Add missing unref implementations for replset, mongos
2 parents 5fbc4db + 650e989 commit a83efd6

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

lib/mongos.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,14 @@ Mongos.prototype.lastIsMaster = function() {
397397
return this.s.mongos.lastIsMaster();
398398
}
399399

400+
/**
401+
* Unref all sockets
402+
* @method
403+
*/
404+
Mongos.prototype.unref = function () {
405+
return this.s.mongos.unref();
406+
}
407+
400408
Mongos.prototype.close = function(forceClosed) {
401409
this.s.mongos.destroy({
402410
force: typeof forceClosed == 'boolean' ? forceClosed : false,

lib/replset.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,14 @@ ReplSet.prototype.lastIsMaster = function() {
445445
return this.s.replset.lastIsMaster();
446446
}
447447

448+
/**
449+
* Unref all sockets
450+
* @method
451+
*/
452+
ReplSet.prototype.unref = function() {
453+
return this.s.replset.unref();
454+
}
455+
448456
ReplSet.prototype.close = function(forceClosed) {
449457
var self = this;
450458
// Call destroy on the topology

0 commit comments

Comments
 (0)