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:
@ -36,7 +36,9 @@ function HttpConnector(host, config) {
|
|||||||
config = _.defaults(config || {}, {
|
config = _.defaults(config || {}, {
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
minSockets: 10,
|
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
|
var Agent = this.hand.Agent; // the class
|
||||||
@ -50,7 +52,8 @@ function HttpConnector(host, config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.agent = new Agent({
|
this.agent = new Agent({
|
||||||
maxSockets: config.maxSockets
|
maxSockets: config.maxSockets,
|
||||||
|
minSockets: config.minSockets
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
_.inherits(HttpConnector, ConnectionAbstract);
|
_.inherits(HttpConnector, ConnectionAbstract);
|
||||||
|
|||||||
Reference in New Issue
Block a user