johnf/github-issue-importer

Abuse rate limit hit

Closed this issue · 3 comments

First off, thanks for creating this useful tool, I was amazed by how easy the bugs were being added to github. I used a personal access token for authentication. After the eighth bug however, github's abuse rate limit was hit (see below). Is there anything you or I can do about that?

 Processing Bug 1460453
/var/lib/gems/1.9.1/gems/octokit-4.0.1/lib/octokit/response/raise_error.rb:16:in `on_complete': POST https://api.github.com/repos/jendrikseipp/rednotebook-issues/issues/8/comments: 403 - You have triggered an abuse detection mechanism and have been temporarily blocked from content creation. Please retry your request again later. // See: https://developer.github.com/v3#abuse-rate-limits (Octokit::AbuseDetected)
    from /var/lib/gems/1.9.1/gems/faraday-0.9.1/lib/faraday/response.rb:9:in `block in call'
    from /var/lib/gems/1.9.1/gems/faraday-0.9.1/lib/faraday/response.rb:57:in `on_complete'
    from /var/lib/gems/1.9.1/gems/faraday-0.9.1/lib/faraday/response.rb:8:in `call'
    from /var/lib/gems/1.9.1/gems/octokit-4.0.1/lib/octokit/middleware/follow_redirects.rb:73:in `perform_with_redirection'
    from /var/lib/gems/1.9.1/gems/octokit-4.0.1/lib/octokit/middleware/follow_redirects.rb:61:in `call'
    from /var/lib/gems/1.9.1/gems/faraday-0.9.1/lib/faraday/rack_builder.rb:139:in `build_response'
    from /var/lib/gems/1.9.1/gems/faraday-0.9.1/lib/faraday/connection.rb:377:in `run_request'
    from /var/lib/gems/1.9.1/gems/faraday-0.9.1/lib/faraday/connection.rb:177:in `post'
    from /var/lib/gems/1.9.1/gems/sawyer-0.6.0/lib/sawyer/agent.rb:94:in `call'
    from /var/lib/gems/1.9.1/gems/octokit-4.0.1/lib/octokit/connection.rb:154:in `request'
    from /var/lib/gems/1.9.1/gems/octokit-4.0.1/lib/octokit/connection.rb:28:in `post'
    from /var/lib/gems/1.9.1/gems/octokit-4.0.1/lib/octokit/client/issues.rb:255:in `add_comment'
    from /var/lib/gems/1.9.1/gems/github-issue-importer-0.0.4/bin/github-issue-importer:98:in `block (2 levels) in <top (required)>'
    from /var/lib/gems/1.9.1/gems/github-issue-importer-0.0.4/bin/github-issue-importer:90:in `each'
    from /var/lib/gems/1.9.1/gems/github-issue-importer-0.0.4/bin/github-issue-importer:90:in `block in <top (required)>'
    from /var/lib/gems/1.9.1/gems/github-issue-importer-0.0.4/bin/github-issue-importer:68:in `each'
    from /var/lib/gems/1.9.1/gems/github-issue-importer-0.0.4/bin/github-issue-importer:68:in `<top (required)>'
    from /usr/local/bin/github-issue-importer:23:in `load'
    from /usr/local/bin/github-issue-importer:23:in `<main>'
johnf commented

I haven't used this tool basically since I wrote it. Possibly there wasn't any rate limiting in place at the time.

The tool could be patched quite easily to rescue that bug and then back off.

That's probably the bet approach.

I am hitting the rate limit after the first bug was imported

johnf commented

thanks to @sionescu there is now an option to sleep between requests #16