Actually pass the minSockets config to the Agent, it's only used by forever-agent but doesn't hurt passing it to http.Agent

This commit is contained in:
Spencer Alger
2014-02-26 12:35:16 -07:00
parent 6f467bc314
commit 5ff3341636

View File

@ -36,7 +36,9 @@ function HttpConnector(host, config) {
config = _.defaults(config || {}, {
keepAlive: true,
minSockets: 10,
maxSockets: 10
// 10 makes sense but 11 actually keeps 10 sockets around
// https://github.com/mikeal/forever-agent/issues/8
maxSockets: 11
});
var Agent = this.hand.Agent; // the class
@ -50,7 +52,8 @@ function HttpConnector(host, config) {
}
this.agent = new Agent({
maxSockets: config.maxSockets
maxSockets: config.maxSockets,
minSockets: config.minSockets
});
}
_.inherits(HttpConnector, ConnectionAbstract);