{"action":"created","comment":{"url":"https://api.github.com/repos/pelias/acceptance-tests/pulls/comments/34614740","id":34614740,"diff_hunk":"@@ -0,0 +1,35 @@\n+'use strict';\n+\n+var ExponentialBackoff = function(minimum_backoff, exponent, starting_backoff) {\n+    if (minimum_backoff === undefined) {\n+        minimum_backoff = 50;\n+    }\n+\n+    if (exponent === undefined) {\n+        exponent = 2.0;\n+    }\n+\n+    if (starting_backoff === undefined) {\n+        starting_backoff = minimum_backoff;\n+    }\n+","path":"lib/ExponentialBackoff.js","position":15,"original_position":15,"commit_id":"c86c0f526de5104c421f13e4fc7ccdcfa82370b2","original_commit_id":"c86c0f526de5104c421f13e4fc7ccdcfa82370b2","user":{"login":"hkrishna","id":840737,"avatar_url":"https://avatars.githubusercontent.com/u/840737?v=3","gravatar_id":"","url":"https://api.github.com/users/hkrishna","html_url":"https://github.com/hkrishna","followers_url":"https://api.github.com/users/hkrishna/followers","following_url":"https://api.github.com/users/hkrishna/following{/other_user}","gists_url":"https://api.github.com/users/hkrishna/gists{/gist_id}","starred_url":"https://api.github.com/users/hkrishna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hkrishna/subscriptions","organizations_url":"https://api.github.com/users/hkrishna/orgs","repos_url":"https://api.github.com/users/hkrishna/repos","events_url":"https://api.github.com/users/hkrishna/events{/privacy}","received_events_url":"https://api.github.com/users/hkrishna/received_events","type":"User","site_admin":false},"body":"you could also use the one-liner\r\n\r\n```\r\nminimum_backoff = minimum_backoff || 50;\r\nexponent = exponent || 2.0;\r\nstarting_backoff = starting_backoff || minimum_backoff;\r\n```\r\n\r\nless number of lines of code :smile_cat: ","created_at":"2015-07-14T20:24:29Z","updated_at":"2015-07-14T20:24:29Z","html_url":"https://github.com/pelias/acceptance-tests/pull/120#discussion_r34614740","pull_request_url":"https://api.github.com/repos/pelias/acceptance-tests/pulls/120","_links":{"self":{"href":"https://api.github.com/repos/pelias/acceptance-tests/pulls/comments/34614740"},"html":{"href":"https://github.com/pelias/acceptance-tests/pull/120#discussion_r34614740"},"pull_request":{"href":"https://api.github.com/repos/pelias/acceptance-tests/pulls/120"}}},"pull_request":{"url":"https://api.github.com/repos/pelias/acceptance-tests/pulls/120","id":39957936,"html_url":"https://github.com/pelias/acceptance-tests/pull/120","diff_url":"https://github.com/pelias/acceptance-tests/pull/120.diff","patch_url":"https://github.com/pelias/acceptance-tests/pull/120.patch","issue_url":"https://api.github.com/repos/pelias/acceptance-tests/issues/120","number":120,"state":"open","locked":false,"title":"Use exponential backoff when running tests","user":{"login":"orangejulius","id":111716,"avatar_url":"https://avatars.githubusercontent.com/u/111716?v=3","gravatar_id":"","url":"https://api.github.com/users/orangejulius","html_url":"https://github.com/orangejulius","followers_url":"https://api.github.com/users/orangejulius/followers","following_url":"https://api.github.com/users/orangejulius/following{/other_user}","gists_url":"https://api.github.com/users/orangejulius/gists{/gist_id}","starred_url":"https://api.github.com/users/orangejulius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orangejulius/subscriptions","organizations_url":"https://api.github.com/users/orangejulius/orgs","repos_url":"https://api.github.com/users/orangejulius/repos","events_url":"https://api.github.com/users/orangejulius/events{/privacy}","received_events_url":"https://api.github.com/users/orangejulius/received_events","type":"User","site_admin":false},"body":"In order to keep our tests from completely killing our production or\r\nstaging servers, this change uses a simple [exponential backoff](https://en.wikipedia.org/wiki/Exponential_backoff)\r\nalgorithm to increase the delay between requests when we get error codes\r\nlike 408 that indicate our server is overloaded.","created_at":"2015-07-14T20:21:27Z","updated_at":"2015-07-14T20:24:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2002892824316e0038a2d76a7909e0419f621db3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pelias/acceptance-tests/pulls/120/commits","review_comments_url":"https://api.github.com/repos/pelias/acceptance-tests/pulls/120/comments","review_comment_url":"https://api.github.com/repos/pelias/acceptance-tests/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pelias/acceptance-tests/issues/120/comments","statuses_url":"https://api.github.com/repos/pelias/acceptance-tests/statuses/c86c0f526de5104c421f13e4fc7ccdcfa82370b2","head":{"label":"pelias:exponential-backoff","ref":"exponential-backoff","sha":"c86c0f526de5104c421f13e4fc7ccdcfa82370b2","user":{"login":"pelias","id":8240367,"avatar_url":"https://avatars.githubusercontent.com/u/8240367?v=3","gravatar_id":"","url":"https://api.github.com/users/pelias","html_url":"https://github.com/pelias","followers_url":"https://api.github.com/users/pelias/followers","following_url":"https://api.github.com/users/pelias/following{/other_user}","gists_url":"https://api.github.com/users/pelias/gists{/gist_id}","starred_url":"https://api.github.com/users/pelias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelias/subscriptions","organizations_url":"https://api.github.com/users/pelias/orgs","repos_url":"https://api.github.com/users/pelias/repos","events_url":"https://api.github.com/users/pelias/events{/privacy}","received_events_url":"https://api.github.com/users/pelias/received_events","type":"Organization","site_admin":false},"repo":{"id":31035247,"name":"acceptance-tests","full_name":"pelias/acceptance-tests","owner":{"login":"pelias","id":8240367,"avatar_url":"https://avatars.githubusercontent.com/u/8240367?v=3","gravatar_id":"","url":"https://api.github.com/users/pelias","html_url":"https://github.com/pelias","followers_url":"https://api.github.com/users/pelias/followers","following_url":"https://api.github.com/users/pelias/following{/other_user}","gists_url":"https://api.github.com/users/pelias/gists{/gist_id}","starred_url":"https://api.github.com/users/pelias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelias/subscriptions","organizations_url":"https://api.github.com/users/pelias/orgs","repos_url":"https://api.github.com/users/pelias/repos","events_url":"https://api.github.com/users/pelias/events{/privacy}","received_events_url":"https://api.github.com/users/pelias/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pelias/acceptance-tests","description":"Pelias API acceptance tests","fork":false,"url":"https://api.github.com/repos/pelias/acceptance-tests","forks_url":"https://api.github.com/repos/pelias/acceptance-tests/forks","keys_url":"https://api.github.com/repos/pelias/acceptance-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pelias/acceptance-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pelias/acceptance-tests/teams","hooks_url":"https://api.github.com/repos/pelias/acceptance-tests/hooks","issue_events_url":"https://api.github.com/repos/pelias/acceptance-tests/issues/events{/number}","events_url":"https://api.github.com/repos/pelias/acceptance-tests/events","assignees_url":"https://api.github.com/repos/pelias/acceptance-tests/assignees{/user}","branches_url":"https://api.github.com/repos/pelias/acceptance-tests/branches{/branch}","tags_url":"https://api.github.com/repos/pelias/acceptance-tests/tags","blobs_url":"https://api.github.com/repos/pelias/acceptance-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pelias/acceptance-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pelias/acceptance-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/pelias/acceptance-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pelias/acceptance-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/pelias/acceptance-tests/languages","stargazers_url":"https://api.github.com/repos/pelias/acceptance-tests/stargazers","contributors_url":"https://api.github.com/repos/pelias/acceptance-tests/contributors","subscribers_url":"https://api.github.com/repos/pelias/acceptance-tests/subscribers","subscription_url":"https://api.github.com/repos/pelias/acceptance-tests/subscription","commits_url":"https://api.github.com/repos/pelias/acceptance-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/pelias/acceptance-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/pelias/acceptance-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/pelias/acceptance-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/pelias/acceptance-tests/contents/{+path}","compare_url":"https://api.github.com/repos/pelias/acceptance-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pelias/acceptance-tests/merges","archive_url":"https://api.github.com/repos/pelias/acceptance-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pelias/acceptance-tests/downloads","issues_url":"https://api.github.com/repos/pelias/acceptance-tests/issues{/number}","pulls_url":"https://api.github.com/repos/pelias/acceptance-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/pelias/acceptance-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/pelias/acceptance-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pelias/acceptance-tests/labels{/name}","releases_url":"https://api.github.com/repos/pelias/acceptance-tests/releases{/id}","created_at":"2015-02-19T20:29:56Z","updated_at":"2015-07-02T14:08:42Z","pushed_at":"2015-07-14T20:21:28Z","git_url":"git://github.com/pelias/acceptance-tests.git","ssh_url":"git@github.com:pelias/acceptance-tests.git","clone_url":"https://github.com/pelias/acceptance-tests.git","svn_url":"https://github.com/pelias/acceptance-tests","homepage":null,"size":1508,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":37,"forks":0,"open_issues":37,"watchers":2,"default_branch":"master"}},"base":{"label":"pelias:master","ref":"master","sha":"36c29373c0f62480dafd9e460e3fca0495e9cbaa","user":{"login":"pelias","id":8240367,"avatar_url":"https://avatars.githubusercontent.com/u/8240367?v=3","gravatar_id":"","url":"https://api.github.com/users/pelias","html_url":"https://github.com/pelias","followers_url":"https://api.github.com/users/pelias/followers","following_url":"https://api.github.com/users/pelias/following{/other_user}","gists_url":"https://api.github.com/users/pelias/gists{/gist_id}","starred_url":"https://api.github.com/users/pelias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelias/subscriptions","organizations_url":"https://api.github.com/users/pelias/orgs","repos_url":"https://api.github.com/users/pelias/repos","events_url":"https://api.github.com/users/pelias/events{/privacy}","received_events_url":"https://api.github.com/users/pelias/received_events","type":"Organization","site_admin":false},"repo":{"id":31035247,"name":"acceptance-tests","full_name":"pelias/acceptance-tests","owner":{"login":"pelias","id":8240367,"avatar_url":"https://avatars.githubusercontent.com/u/8240367?v=3","gravatar_id":"","url":"https://api.github.com/users/pelias","html_url":"https://github.com/pelias","followers_url":"https://api.github.com/users/pelias/followers","following_url":"https://api.github.com/users/pelias/following{/other_user}","gists_url":"https://api.github.com/users/pelias/gists{/gist_id}","starred_url":"https://api.github.com/users/pelias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelias/subscriptions","organizations_url":"https://api.github.com/users/pelias/orgs","repos_url":"https://api.github.com/users/pelias/repos","events_url":"https://api.github.com/users/pelias/events{/privacy}","received_events_url":"https://api.github.com/users/pelias/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pelias/acceptance-tests","description":"Pelias API acceptance tests","fork":false,"url":"https://api.github.com/repos/pelias/acceptance-tests","forks_url":"https://api.github.com/repos/pelias/acceptance-tests/forks","keys_url":"https://api.github.com/repos/pelias/acceptance-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pelias/acceptance-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pelias/acceptance-tests/teams","hooks_url":"https://api.github.com/repos/pelias/acceptance-tests/hooks","issue_events_url":"https://api.github.com/repos/pelias/acceptance-tests/issues/events{/number}","events_url":"https://api.github.com/repos/pelias/acceptance-tests/events","assignees_url":"https://api.github.com/repos/pelias/acceptance-tests/assignees{/user}","branches_url":"https://api.github.com/repos/pelias/acceptance-tests/branches{/branch}","tags_url":"https://api.github.com/repos/pelias/acceptance-tests/tags","blobs_url":"https://api.github.com/repos/pelias/acceptance-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pelias/acceptance-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pelias/acceptance-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/pelias/acceptance-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pelias/acceptance-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/pelias/acceptance-tests/languages","stargazers_url":"https://api.github.com/repos/pelias/acceptance-tests/stargazers","contributors_url":"https://api.github.com/repos/pelias/acceptance-tests/contributors","subscribers_url":"https://api.github.com/repos/pelias/acceptance-tests/subscribers","subscription_url":"https://api.github.com/repos/pelias/acceptance-tests/subscription","commits_url":"https://api.github.com/repos/pelias/acceptance-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/pelias/acceptance-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/pelias/acceptance-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/pelias/acceptance-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/pelias/acceptance-tests/contents/{+path}","compare_url":"https://api.github.com/repos/pelias/acceptance-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pelias/acceptance-tests/merges","archive_url":"https://api.github.com/repos/pelias/acceptance-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pelias/acceptance-tests/downloads","issues_url":"https://api.github.com/repos/pelias/acceptance-tests/issues{/number}","pulls_url":"https://api.github.com/repos/pelias/acceptance-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/pelias/acceptance-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/pelias/acceptance-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pelias/acceptance-tests/labels{/name}","releases_url":"https://api.github.com/repos/pelias/acceptance-tests/releases{/id}","created_at":"2015-02-19T20:29:56Z","updated_at":"2015-07-02T14:08:42Z","pushed_at":"2015-07-14T20:21:28Z","git_url":"git://github.com/pelias/acceptance-tests.git","ssh_url":"git@github.com:pelias/acceptance-tests.git","clone_url":"https://github.com/pelias/acceptance-tests.git","svn_url":"https://github.com/pelias/acceptance-tests","homepage":null,"size":1508,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":37,"forks":0,"open_issues":37,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pelias/acceptance-tests/pulls/120"},"html":{"href":"https://github.com/pelias/acceptance-tests/pull/120"},"issue":{"href":"https://api.github.com/repos/pelias/acceptance-tests/issues/120"},"comments":{"href":"https://api.github.com/repos/pelias/acceptance-tests/issues/120/comments"},"review_comments":{"href":"https://api.github.com/repos/pelias/acceptance-tests/pulls/120/comments"},"review_comment":{"href":"https://api.github.com/repos/pelias/acceptance-tests/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pelias/acceptance-tests/pulls/120/commits"},"statuses":{"href":"https://api.github.com/repos/pelias/acceptance-tests/statuses/c86c0f526de5104c421f13e4fc7ccdcfa82370b2"}}}}