You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
because it's creates new agents every request, for example:
varrequest=Request.forever({maxSockets: 2});varr1=request("http://google.com",function(){});varr2=request("http://google.com",function(){});console.log(r1.agent===r2.agent);//prints false, but should be true
Generally speaking the forever option should not be used in anything higher than node 0.10 (as stated in the docs), see #1671 for details. Your fix proposal looks good 👍
calibr
pushed a commit
to calibr/request
that referenced
this issue
Aug 4, 2015
because it's creates new agents every request, for example:
Problem is here https://github.com/request/request/blob/master/request.js#L486 .
This can be fixed by replacing this line by something like this:
Such behaviour makes sockets not reusable, because creates new pool(agent) every http request.
The text was updated successfully, but these errors were encountered: