Skip to content

Add github api retries#45

Merged
carlosms merged 1 commit into
src-d:masterfrom
carlosms:retries
Jun 20, 2019
Merged

Add github api retries#45
carlosms merged 1 commit into
src-d:masterfrom
carlosms:retries

Conversation

@carlosms
Copy link
Copy Markdown
Contributor

Part of #37.

The logs will look like this:

[2019-06-20T12:58:34.236908691+01:00]  INFO The DB was upgraded
[2019-06-20T12:58:35.032506058+01:00]  INFO connection with the DB established
[2019-06-20T12:58:35.034241516+01:00] ERROR retrying in 10ms error=Get https://api.github.com/orgs/carlosms-test-org: dial tcp: lookup api.github.com: no such host organization=carlosms-test-org
[2019-06-20T12:58:35.045928805+01:00] ERROR retrying in 20ms error=Get https://api.github.com/orgs/carlosms-test-org: dial tcp: lookup api.github.com: no such host organization=carlosms-test-org
[2019-06-20T12:58:35.06757551+01:00] ERROR retrying in 60ms error=Get https://api.github.com/orgs/carlosms-test-org: dial tcp: lookup api.github.com: no such host organization=carlosms-test-org
[2019-06-20T12:58:35.129441857+01:00] ERROR retrying in 300ms error=Get https://api.github.com/orgs/carlosms-test-org: dial tcp: lookup api.github.com: no such host organization=carlosms-test-org
[2019-06-20T12:58:35.431817809+01:00] ERROR retrying in 2.7s error=Get https://api.github.com/orgs/carlosms-test-org: dial tcp: lookup api.github.com: no such host organization=carlosms-test-org
[2019-06-20T12:58:38.134222928+01:00] ERROR retrying in 10s error=Get https://api.github.com/orgs/carlosms-test-org: dial tcp: lookup api.github.com: no such host organization=carlosms-test-org
[2019-06-20T12:58:48.137069102+01:00] ERROR retrying in 10s error=Get https://api.github.com/orgs/carlosms-test-org: dial tcp: lookup api.github.com: no such host organization=carlosms-test-org
[2019-06-20T12:58:58.139183198+01:00] ERROR retrying in 10s error=Get https://api.github.com/orgs/carlosms-test-org: dial tcp: lookup api.github.com: no such host organization=carlosms-test-org
[2019-06-20T12:59:08.141450129+01:00] ERROR retrying in 10s error=Get https://api.github.com/orgs/carlosms-test-org: dial tcp: lookup api.github.com: no such host organization=carlosms-test-org
[2019-06-20T12:59:18.14380071+01:00] ERROR retrying in 10s error=Get https://api.github.com/orgs/carlosms-test-org: dial tcp: lookup api.github.com: no such host organization=carlosms-test-org
Get https://api.github.com/orgs/carlosms-test-org: dial tcp: lookup api.github.com: no such host
exit status 1

@carlosms carlosms requested a review from a team June 20, 2019 12:07
Comment thread shallow/common.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it's better to implement on transport level? (http.RoundTripper)
then all the request can be wrapped into retry automatically? Less code, less chance to make a mistake.

@carlosms
Copy link
Copy Markdown
Contributor Author

Changed to be a RoundTripper in d7b18c5.
I left the previous code + revert for the review, will squash before merging.

Signed-off-by: Carlos Martín <carlos.martin.sanchez@gmail.com>
@carlosms carlosms merged commit 24e89dc into src-d:master Jun 20, 2019
@carlosms carlosms deleted the retries branch June 20, 2019 15:50
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

Successfully merging this pull request may close these issues.

3 participants