{"action":"created","comment":{"url":"https://api.github.com/repos/tbruyelle/hipchat-go/pulls/comments/85278714","pull_request_review_id":5999962,"id":85278714,"diff_hunk":"@@ -275,6 +325,58 @@ func (c *Client) Do(req *http.Request, v interface{}) (*http.Response, error) {\n \treturn resp, err\n }\n \n+func (c *Client) doWithRetryPolicy(req *http.Request, policy RetryPolicy) (*http.Response, error) {\n+\tcurrentTry := 0\n+\n+\tfor willContinue(currentTry, policy) {\n+\t\tcurrentTry = currentTry + 1\n+\t\tresp, err := c.client.Do(req)\n+\t\tif err != nil {\n+\t\t\treturn nil, err\n+\t\t}\n+\t\tc.captureRateLimits(resp)\n+\t\tif code := resp.StatusCode; code == http.StatusTooManyRequests {","path":"hipchat/hipchat.go","position":111,"original_position":111,"commit_id":"6192e0be69ab31e25e4e390e6956ea588a7bb284","original_commit_id":"6192e0be69ab31e25e4e390e6956ea588a7bb284","user":{"login":"tbruyelle","id":92280,"avatar_url":"https://avatars.githubusercontent.com/u/92280?v=3","gravatar_id":"","url":"https://api.github.com/users/tbruyelle","html_url":"https://github.com/tbruyelle","followers_url":"https://api.github.com/users/tbruyelle/followers","following_url":"https://api.github.com/users/tbruyelle/following{/other_user}","gists_url":"https://api.github.com/users/tbruyelle/gists{/gist_id}","starred_url":"https://api.github.com/users/tbruyelle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbruyelle/subscriptions","organizations_url":"https://api.github.com/users/tbruyelle/orgs","repos_url":"https://api.github.com/users/tbruyelle/repos","events_url":"https://api.github.com/users/tbruyelle/events{/privacy}","received_events_url":"https://api.github.com/users/tbruyelle/received_events","type":"User","site_admin":false},"body":"```go\r\nif resp.StatusCode ==  http.StatusTooManyRequests {\r\n```\r\nYou don't reuse the code so the var is useless I think.","created_at":"2016-10-27T07:23:34Z","updated_at":"2016-10-27T07:54:23Z","html_url":"https://github.com/tbruyelle/hipchat-go/pull/50#discussion_r85278714","pull_request_url":"https://api.github.com/repos/tbruyelle/hipchat-go/pulls/50","_links":{"self":{"href":"https://api.github.com/repos/tbruyelle/hipchat-go/pulls/comments/85278714"},"html":{"href":"https://github.com/tbruyelle/hipchat-go/pull/50#discussion_r85278714"},"pull_request":{"href":"https://api.github.com/repos/tbruyelle/hipchat-go/pulls/50"}}},"pull_request":{"url":"https://api.github.com/repos/tbruyelle/hipchat-go/pulls/50","id":90462059,"html_url":"https://github.com/tbruyelle/hipchat-go/pull/50","diff_url":"https://github.com/tbruyelle/hipchat-go/pull/50.diff","patch_url":"https://github.com/tbruyelle/hipchat-go/pull/50.patch","issue_url":"https://api.github.com/repos/tbruyelle/hipchat-go/issues/50","number":50,"state":"open","locked":false,"title":"Implement api retry on rate limits","user":{"login":"afinkenstadt","id":5892856,"avatar_url":"https://avatars.githubusercontent.com/u/5892856?v=3","gravatar_id":"","url":"https://api.github.com/users/afinkenstadt","html_url":"https://github.com/afinkenstadt","followers_url":"https://api.github.com/users/afinkenstadt/followers","following_url":"https://api.github.com/users/afinkenstadt/following{/other_user}","gists_url":"https://api.github.com/users/afinkenstadt/gists{/gist_id}","starred_url":"https://api.github.com/users/afinkenstadt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afinkenstadt/subscriptions","organizations_url":"https://api.github.com/users/afinkenstadt/orgs","repos_url":"https://api.github.com/users/afinkenstadt/repos","events_url":"https://api.github.com/users/afinkenstadt/events{/privacy}","received_events_url":"https://api.github.com/users/afinkenstadt/received_events","type":"User","site_admin":false},"body":"Implements #46 ","created_at":"2016-10-22T00:10:54Z","updated_at":"2016-10-27T07:54:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5c1da29950d914e6675d0e827c0c4db3538e9a39","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/tbruyelle/hipchat-go/pulls/50/commits","review_comments_url":"https://api.github.com/repos/tbruyelle/hipchat-go/pulls/50/comments","review_comment_url":"https://api.github.com/repos/tbruyelle/hipchat-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tbruyelle/hipchat-go/issues/50/comments","statuses_url":"https://api.github.com/repos/tbruyelle/hipchat-go/statuses/6192e0be69ab31e25e4e390e6956ea588a7bb284","head":{"label":"afinkenstadt:implement_api_retry","ref":"implement_api_retry","sha":"6192e0be69ab31e25e4e390e6956ea588a7bb284","user":{"login":"afinkenstadt","id":5892856,"avatar_url":"https://avatars.githubusercontent.com/u/5892856?v=3","gravatar_id":"","url":"https://api.github.com/users/afinkenstadt","html_url":"https://github.com/afinkenstadt","followers_url":"https://api.github.com/users/afinkenstadt/followers","following_url":"https://api.github.com/users/afinkenstadt/following{/other_user}","gists_url":"https://api.github.com/users/afinkenstadt/gists{/gist_id}","starred_url":"https://api.github.com/users/afinkenstadt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afinkenstadt/subscriptions","organizations_url":"https://api.github.com/users/afinkenstadt/orgs","repos_url":"https://api.github.com/users/afinkenstadt/repos","events_url":"https://api.github.com/users/afinkenstadt/events{/privacy}","received_events_url":"https://api.github.com/users/afinkenstadt/received_events","type":"User","site_admin":false},"repo":{"id":71389023,"name":"hipchat-go","full_name":"afinkenstadt/hipchat-go","owner":{"login":"afinkenstadt","id":5892856,"avatar_url":"https://avatars.githubusercontent.com/u/5892856?v=3","gravatar_id":"","url":"https://api.github.com/users/afinkenstadt","html_url":"https://github.com/afinkenstadt","followers_url":"https://api.github.com/users/afinkenstadt/followers","following_url":"https://api.github.com/users/afinkenstadt/following{/other_user}","gists_url":"https://api.github.com/users/afinkenstadt/gists{/gist_id}","starred_url":"https://api.github.com/users/afinkenstadt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afinkenstadt/subscriptions","organizations_url":"https://api.github.com/users/afinkenstadt/orgs","repos_url":"https://api.github.com/users/afinkenstadt/repos","events_url":"https://api.github.com/users/afinkenstadt/events{/privacy}","received_events_url":"https://api.github.com/users/afinkenstadt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/afinkenstadt/hipchat-go","description":"Go client library for the HipChat API v2","fork":true,"url":"https://api.github.com/repos/afinkenstadt/hipchat-go","forks_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/forks","keys_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/teams","hooks_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/hooks","issue_events_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/issues/events{/number}","events_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/events","assignees_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/assignees{/user}","branches_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/branches{/branch}","tags_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/tags","blobs_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/statuses/{sha}","languages_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/languages","stargazers_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/stargazers","contributors_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/contributors","subscribers_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/subscribers","subscription_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/subscription","commits_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/contents/{+path}","compare_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/merges","archive_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/downloads","issues_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/issues{/number}","pulls_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/pulls{/number}","milestones_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/milestones{/number}","notifications_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/labels{/name}","releases_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/releases{/id}","deployments_url":"https://api.github.com/repos/afinkenstadt/hipchat-go/deployments","created_at":"2016-10-19T18:49:01Z","updated_at":"2016-10-19T18:49:03Z","pushed_at":"2016-10-24T18:35:29Z","git_url":"git://github.com/afinkenstadt/hipchat-go.git","ssh_url":"git@github.com:afinkenstadt/hipchat-go.git","clone_url":"https://github.com/afinkenstadt/hipchat-go.git","svn_url":"https://github.com/afinkenstadt/hipchat-go","homepage":null,"size":1874,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tbruyelle:master","ref":"master","sha":"bba574c2603ee446b29ac28f50d3b9b94370ccc1","user":{"login":"tbruyelle","id":92280,"avatar_url":"https://avatars.githubusercontent.com/u/92280?v=3","gravatar_id":"","url":"https://api.github.com/users/tbruyelle","html_url":"https://github.com/tbruyelle","followers_url":"https://api.github.com/users/tbruyelle/followers","following_url":"https://api.github.com/users/tbruyelle/following{/other_user}","gists_url":"https://api.github.com/users/tbruyelle/gists{/gist_id}","starred_url":"https://api.github.com/users/tbruyelle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbruyelle/subscriptions","organizations_url":"https://api.github.com/users/tbruyelle/orgs","repos_url":"https://api.github.com/users/tbruyelle/repos","events_url":"https://api.github.com/users/tbruyelle/events{/privacy}","received_events_url":"https://api.github.com/users/tbruyelle/received_events","type":"User","site_admin":false},"repo":{"id":24943022,"name":"hipchat-go","full_name":"tbruyelle/hipchat-go","owner":{"login":"tbruyelle","id":92280,"avatar_url":"https://avatars.githubusercontent.com/u/92280?v=3","gravatar_id":"","url":"https://api.github.com/users/tbruyelle","html_url":"https://github.com/tbruyelle","followers_url":"https://api.github.com/users/tbruyelle/followers","following_url":"https://api.github.com/users/tbruyelle/following{/other_user}","gists_url":"https://api.github.com/users/tbruyelle/gists{/gist_id}","starred_url":"https://api.github.com/users/tbruyelle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbruyelle/subscriptions","organizations_url":"https://api.github.com/users/tbruyelle/orgs","repos_url":"https://api.github.com/users/tbruyelle/repos","events_url":"https://api.github.com/users/tbruyelle/events{/privacy}","received_events_url":"https://api.github.com/users/tbruyelle/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tbruyelle/hipchat-go","description":"Go client library for the HipChat API v2","fork":false,"url":"https://api.github.com/repos/tbruyelle/hipchat-go","forks_url":"https://api.github.com/repos/tbruyelle/hipchat-go/forks","keys_url":"https://api.github.com/repos/tbruyelle/hipchat-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tbruyelle/hipchat-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tbruyelle/hipchat-go/teams","hooks_url":"https://api.github.com/repos/tbruyelle/hipchat-go/hooks","issue_events_url":"https://api.github.com/repos/tbruyelle/hipchat-go/issues/events{/number}","events_url":"https://api.github.com/repos/tbruyelle/hipchat-go/events","assignees_url":"https://api.github.com/repos/tbruyelle/hipchat-go/assignees{/user}","branches_url":"https://api.github.com/repos/tbruyelle/hipchat-go/branches{/branch}","tags_url":"https://api.github.com/repos/tbruyelle/hipchat-go/tags","blobs_url":"https://api.github.com/repos/tbruyelle/hipchat-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tbruyelle/hipchat-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tbruyelle/hipchat-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/tbruyelle/hipchat-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tbruyelle/hipchat-go/statuses/{sha}","languages_url":"https://api.github.com/repos/tbruyelle/hipchat-go/languages","stargazers_url":"https://api.github.com/repos/tbruyelle/hipchat-go/stargazers","contributors_url":"https://api.github.com/repos/tbruyelle/hipchat-go/contributors","subscribers_url":"https://api.github.com/repos/tbruyelle/hipchat-go/subscribers","subscription_url":"https://api.github.com/repos/tbruyelle/hipchat-go/subscription","commits_url":"https://api.github.com/repos/tbruyelle/hipchat-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/tbruyelle/hipchat-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/tbruyelle/hipchat-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/tbruyelle/hipchat-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/tbruyelle/hipchat-go/contents/{+path}","compare_url":"https://api.github.com/repos/tbruyelle/hipchat-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tbruyelle/hipchat-go/merges","archive_url":"https://api.github.com/repos/tbruyelle/hipchat-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tbruyelle/hipchat-go/downloads","issues_url":"https://api.github.com/repos/tbruyelle/hipchat-go/issues{/number}","pulls_url":"https://api.github.com/repos/tbruyelle/hipchat-go/pulls{/number}","milestones_url":"https://api.github.com/repos/tbruyelle/hipchat-go/milestones{/number}","notifications_url":"https://api.github.com/repos/tbruyelle/hipchat-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tbruyelle/hipchat-go/labels{/name}","releases_url":"https://api.github.com/repos/tbruyelle/hipchat-go/releases{/id}","deployments_url":"https://api.github.com/repos/tbruyelle/hipchat-go/deployments","created_at":"2014-10-08T13:54:50Z","updated_at":"2016-10-24T10:08:08Z","pushed_at":"2016-10-24T18:34:20Z","git_url":"git://github.com/tbruyelle/hipchat-go.git","ssh_url":"git@github.com:tbruyelle/hipchat-go.git","clone_url":"https://github.com/tbruyelle/hipchat-go.git","svn_url":"https://github.com/tbruyelle/hipchat-go","homepage":null,"size":1900,"stargazers_count":92,"watchers_count":92,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":42,"mirror_url":null,"open_issues_count":5,"forks":42,"open_issues":5,"watchers":92,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tbruyelle/hipchat-go/pulls/50"},"html":{"href":"https://github.com/tbruyelle/hipchat-go/pull/50"},"issue":{"href":"https://api.github.com/repos/tbruyelle/hipchat-go/issues/50"},"comments":{"href":"https://api.github.com/repos/tbruyelle/hipchat-go/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/tbruyelle/hipchat-go/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/tbruyelle/hipchat-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tbruyelle/hipchat-go/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/tbruyelle/hipchat-go/statuses/6192e0be69ab31e25e4e390e6956ea588a7bb284"}}}}
{"actor":{"display_login":"tbruyelle"}}