src-d / ghsync

GitHub API v3 > PostgreSQL
https://sourced.tech
GNU General Public License v3.0
9 stars 8 forks source link

List endpoints #32

Closed carlosms closed 5 years ago

carlosms commented 5 years ago

Fix #30.

Now there are 2 sub commands, deep for the previous code, and shallow for the new endpoints. The download time for src-d is around 15m, and it takes around 500 API calls.

I chose to exit early when any error is found. The other alternative would be to log the error and continue, but I thought the errors we will find will probably be a broken internet connectivity, or the DB is down. In any of these, logging the errors and continue will just flood the logs with error messages and not really continue to do any work.

I will submit another incremental PR (#34) to get rid of all the FindOne DB calls for each individual issue and PR. But the time does not really improve, it seems most of the time is spent on the API calls.