instagram-node-lib
instagram-node-lib copied to clipboard
instagram-node-lib not response after running for about an hours
I use the lib to retrieve instagram pics of a tag=love repeatedly. After running for about an hour. The lib is not response any more, no error throw ... just do nothing.
I've solved this by setting time out to http request in class.instagram.js below,
InstagramAPI.prototype._request = function(params) {
...
request.setTimeout( 10000, function( ) {
request.abort();
});
if (post_data != null) {
request.write(post_data);
}
request.addListener('error', function(connectionException) {
if (connectionException.code !== 'ENOTCONN') {
if (appResponse != null) {
return error(connectionException, options, "_request", appResponse);
} else {
return error(connectionException, options, "_request");
}
}
});