gavinr / github-csv-tools

Import and export GitHub issues via CSV
https://npmjs.com/github-csv-tools
MIT License
661 stars 118 forks source link

API Request Throttling (with milestones) #2

Closed kwhite closed 7 years ago

kwhite commented 7 years ago

Hi!

I was using your awesome package to import a slew of issues, and bumped up against the abuse rate limit. GitHub will only allow ~25 concurrent content creation requests from a single GitHub user before it shuts you down. So I've added bottleneck and some simple throttling to keep this to 20 open requests sent 200ms apart.

I also added milestones (because I needed them) and did a little work on the JSON output; for me, if I had an empty string value in the labels array for some requests GitHub was not happy with me.

Hope this is helpful!

gavinr commented 7 years ago

@kwhite thanks so much for the PR! Great to see someone else getting use of the tools. The code looks good to me; I'll test it later today or tomorrow and then merge it in. Thanks!