{"action":"created","comment":{"url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/comments/167035617","pull_request_review_id":95194392,"id":167035617,"diff_hunk":"@@ -68,11 +69,16 @@ def search_transactions(filters, fields, sort, order, lower_limit, limit):\n     index_name = '{}-{}'.format(TRANSACTIONS_INDEX_ROOT,\n                                 transaction_type.lower().replace(' ', ''))\n     index_name = index_name[:-1]+'*'\n-    try:\n-        response = CLIENT.search(index=index_name, body=query)\n-    except Exception:\n-        logging.exception(\"There was an error connecting to the ElasticSearch instance.\")\n-        return None\n+    found_result = 0\n+    while not found_result > 10:\n+        found_result += 1\n+        try:\n+            response = CLIENT.search(index=index_name, body=query)\n+        except (TransportError, ConnectionError) as e:\n+            logger.error(e)\n+            logging.exception(\"There was an error connecting to the ElasticSearch instance.\")\n+            if found_result == 10:\n+                return HttpResponseServerError()","path":"usaspending_api/search/v2/elasticsearch_helper.py","position":26,"original_position":26,"commit_id":"123f4efad6d428faa048bf21acd91c6c10937f13","original_commit_id":"123f4efad6d428faa048bf21acd91c6c10937f13","user":{"login":"tony-sappe","id":22781949,"avatar_url":"https://avatars1.githubusercontent.com/u/22781949?v=4","gravatar_id":"","url":"https://api.github.com/users/tony-sappe","html_url":"https://github.com/tony-sappe","followers_url":"https://api.github.com/users/tony-sappe/followers","following_url":"https://api.github.com/users/tony-sappe/following{/other_user}","gists_url":"https://api.github.com/users/tony-sappe/gists{/gist_id}","starred_url":"https://api.github.com/users/tony-sappe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tony-sappe/subscriptions","organizations_url":"https://api.github.com/users/tony-sappe/orgs","repos_url":"https://api.github.com/users/tony-sappe/repos","events_url":"https://api.github.com/users/tony-sappe/events{/privacy}","received_events_url":"https://api.github.com/users/tony-sappe/received_events","type":"User","site_admin":false},"body":"What is the behavior of using this return object for the functions? It might work for the Django view classes but I am skeptical it works for these helper functions. Can you please share in the PR comments before and after responses showing the differences?","created_at":"2018-02-08T19:02:55Z","updated_at":"2018-02-08T19:02:55Z","html_url":"https://github.com/fedspendingtransparency/usaspending-api/pull/953#discussion_r167035617","pull_request_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/953","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/comments/167035617"},"html":{"href":"https://github.com/fedspendingtransparency/usaspending-api/pull/953#discussion_r167035617"},"pull_request":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/953"}}},"pull_request":{"url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/953","id":168058400,"html_url":"https://github.com/fedspendingtransparency/usaspending-api/pull/953","diff_url":"https://github.com/fedspendingtransparency/usaspending-api/pull/953.diff","patch_url":"https://github.com/fedspendingtransparency/usaspending-api/pull/953.patch","issue_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/953","number":953,"state":"open","locked":false,"title":"Feature 500 request response","user":{"login":"MelvinDunn","id":12663957,"avatar_url":"https://avatars0.githubusercontent.com/u/12663957?v=4","gravatar_id":"","url":"https://api.github.com/users/MelvinDunn","html_url":"https://github.com/MelvinDunn","followers_url":"https://api.github.com/users/MelvinDunn/followers","following_url":"https://api.github.com/users/MelvinDunn/following{/other_user}","gists_url":"https://api.github.com/users/MelvinDunn/gists{/gist_id}","starred_url":"https://api.github.com/users/MelvinDunn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MelvinDunn/subscriptions","organizations_url":"https://api.github.com/users/MelvinDunn/orgs","repos_url":"https://api.github.com/users/MelvinDunn/repos","events_url":"https://api.github.com/users/MelvinDunn/events{/privacy}","received_events_url":"https://api.github.com/users/MelvinDunn/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-08T18:58:55Z","updated_at":"2018-02-08T19:02:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c1ee70c4d378ff35f5ee2311fc5cf17db4b4bd5c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/953/commits","review_comments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/953/comments","review_comment_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/953/comments","statuses_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/statuses/123f4efad6d428faa048bf21acd91c6c10937f13","head":{"label":"fedspendingtransparency:feature-500-request-response","ref":"feature-500-request-response","sha":"123f4efad6d428faa048bf21acd91c6c10937f13","user":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars0.githubusercontent.com/u/8397762?v=4","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"repo":{"id":65394827,"name":"usaspending-api","full_name":"fedspendingtransparency/usaspending-api","owner":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars0.githubusercontent.com/u/8397762?v=4","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fedspendingtransparency/usaspending-api","description":"An RESTful API for U.S. federal spending data.","fork":false,"url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api","forks_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/forks","keys_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/teams","hooks_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/hooks","issue_events_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/events{/number}","events_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/events","assignees_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/assignees{/user}","branches_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/branches{/branch}","tags_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/tags","blobs_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/statuses/{sha}","languages_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/languages","stargazers_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/stargazers","contributors_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/contributors","subscribers_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/subscribers","subscription_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/subscription","commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/contents/{+path}","compare_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/merges","archive_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/downloads","issues_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues{/number}","pulls_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls{/number}","milestones_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/milestones{/number}","notifications_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/labels{/name}","releases_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/releases{/id}","deployments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/deployments","created_at":"2016-08-10T15:39:45Z","updated_at":"2018-01-29T17:30:32Z","pushed_at":"2018-02-08T18:58:56Z","git_url":"git://github.com/fedspendingtransparency/usaspending-api.git","ssh_url":"git@github.com:fedspendingtransparency/usaspending-api.git","clone_url":"https://github.com/fedspendingtransparency/usaspending-api.git","svn_url":"https://github.com/fedspendingtransparency/usaspending-api","homepage":"","size":47871,"stargazers_count":52,"watchers_count":52,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":9,"license":null,"forks":14,"open_issues":9,"watchers":52,"default_branch":"dev"}},"base":{"label":"fedspendingtransparency:dev","ref":"dev","sha":"23d617e1a42410d97f8e54fe449fb5bc6a934552","user":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars0.githubusercontent.com/u/8397762?v=4","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"repo":{"id":65394827,"name":"usaspending-api","full_name":"fedspendingtransparency/usaspending-api","owner":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars0.githubusercontent.com/u/8397762?v=4","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fedspendingtransparency/usaspending-api","description":"An RESTful API for U.S. federal spending data.","fork":false,"url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api","forks_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/forks","keys_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/teams","hooks_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/hooks","issue_events_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/events{/number}","events_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/events","assignees_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/assignees{/user}","branches_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/branches{/branch}","tags_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/tags","blobs_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/statuses/{sha}","languages_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/languages","stargazers_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/stargazers","contributors_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/contributors","subscribers_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/subscribers","subscription_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/subscription","commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/contents/{+path}","compare_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/merges","archive_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/downloads","issues_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues{/number}","pulls_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls{/number}","milestones_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/milestones{/number}","notifications_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/labels{/name}","releases_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/releases{/id}","deployments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/deployments","created_at":"2016-08-10T15:39:45Z","updated_at":"2018-01-29T17:30:32Z","pushed_at":"2018-02-08T18:58:56Z","git_url":"git://github.com/fedspendingtransparency/usaspending-api.git","ssh_url":"git@github.com:fedspendingtransparency/usaspending-api.git","clone_url":"https://github.com/fedspendingtransparency/usaspending-api.git","svn_url":"https://github.com/fedspendingtransparency/usaspending-api","homepage":"","size":47871,"stargazers_count":52,"watchers_count":52,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":9,"license":null,"forks":14,"open_issues":9,"watchers":52,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/953"},"html":{"href":"https://github.com/fedspendingtransparency/usaspending-api/pull/953"},"issue":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/953"},"comments":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/953/comments"},"review_comments":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/953/comments"},"review_comment":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/953/commits"},"statuses":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/statuses/123f4efad6d428faa048bf21acd91c6c10937f13"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tony-sappe"}}