src-d / ghsync

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

Fix handling of rate limit by checking response headers in transport #51

Closed se7entyse7en closed 5 years ago

se7entyse7en commented 5 years ago

Closes #11.

This fixes the rate limiter by checking the response headers and sleeping after the last remaining request has been done. See the issue for details.

carlosms commented 5 years ago

Does it make sense to have tests for it? Or will it be completely mocked, and we won't be really testing much...?

se7entyse7en commented 5 years ago

Does it make sense to have tests for it? Or will it be completely mocked, and we won't be really testing much...?

I'd open an issue for this to decide also how to test, and this should also be part of the testing design doc. I guess that the main point is whether we want to mock or use a fake org. Even if we decide to mock, this feature would be tested anyway if we're able to assert that the sleep occurs.

se7entyse7en commented 5 years ago

Opened issue #53 for testing.