Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

instagram-node-lib not response after running for about an hours #22

Open
songpr opened this issue Nov 11, 2013 · 0 comments
Open

instagram-node-lib not response after running for about an hours #22

songpr opened this issue Nov 11, 2013 · 0 comments

Comments

@songpr
Copy link

songpr commented Nov 11, 2013

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");
          }
        }
      });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant