Search code examples
node.jshttpsrequestnode-request

nodejs request only able to send 10 requests


I've created a nodejs program which basically verifies facebook tokens by using the https graph api via an https request as follows:

var request=require("request")
request('https://graph.facebook.com/me?fields=id,first_name,last_name,email,name,gender,picture&access_token='+data.fb_token,function(error,response,body){
    ...
    console.log('request #'+(++reqCount)+' has completed!');
});

The problem is that I am only able to make 10 single requests. Any requests made after the 10th never complete (ie, the callback is never called and there is no data sent back). I've tried adding a timeout parameter in a parametrized request to no avail.


Solution

  • I've discovered that it was a separate bug. I was using a database connection pool and not releasing them.