We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f15a027 + fb118cf commit b12dd4cCopy full SHA for b12dd4c
lib/pool.js
@@ -33,10 +33,20 @@ var pools = {
33
pool.destroy(client);
34
});
35
36
+ // Remove connection from pool on disconnect
37
+ client.on('end', function(e) {
38
+ // Do not enter infinite loop between pool.destroy
39
+ // and client 'end' event...
40
+ if ( ! client._destroying ) {
41
+ pool.destroy(client);
42
+ }
43
+ });
44
+
45
return cb(null, client);
46
47
},
48
destroy: function(client) {
49
+ client._destroying = true;
50
client.end();
51
}
52
0 commit comments