{"action":"created","issue":{"url":"https://api.github.com/repos/algolia/algoliasearch-client-ruby/issues/162","repository_url":"https://api.github.com/repos/algolia/algoliasearch-client-ruby","labels_url":"https://api.github.com/repos/algolia/algoliasearch-client-ruby/issues/162/labels{/name}","comments_url":"https://api.github.com/repos/algolia/algoliasearch-client-ruby/issues/162/comments","events_url":"https://api.github.com/repos/algolia/algoliasearch-client-ruby/issues/162/events","html_url":"https://github.com/algolia/algoliasearch-client-ruby/pull/162","id":200178882,"number":162,"title":"Update fallback host logic to reflect comment","user":{"login":"jstultz","id":308104,"avatar_url":"https://avatars.githubusercontent.com/u/308104?v=3","gravatar_id":"","url":"https://api.github.com/users/jstultz","html_url":"https://github.com/jstultz","followers_url":"https://api.github.com/users/jstultz/followers","following_url":"https://api.github.com/users/jstultz/following{/other_user}","gists_url":"https://api.github.com/users/jstultz/gists{/gist_id}","starred_url":"https://api.github.com/users/jstultz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jstultz/subscriptions","organizations_url":"https://api.github.com/users/jstultz/orgs","repos_url":"https://api.github.com/users/jstultz/repos","events_url":"https://api.github.com/users/jstultz/events{/privacy}","received_events_url":"https://api.github.com/users/jstultz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-01-11T19:03:18Z","updated_at":"2017-01-11T19:14:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/algolia/algoliasearch-client-ruby/pulls/162","html_url":"https://github.com/algolia/algoliasearch-client-ruby/pull/162","diff_url":"https://github.com/algolia/algoliasearch-client-ruby/pull/162.diff","patch_url":"https://github.com/algolia/algoliasearch-client-ruby/pull/162.patch"},"body":"The behavior exhibited by the if statement does not reflect the\r\ndescription in the comment below it: instead of reusing a fallback host if\r\nit's been in use for less than a minute, it actually reuses the fallback\r\nhost only if it was last used more than a minute ago.\r\n\r\nThis was not caught by the test that was added with it, because the test\r\nlogic is faulty as well: the only way it could fail is if the value of\r\n`Time.now` actually decreased over time.\r\n\r\nThis updates the test to assert that the second call completes in less\r\nthan a second, rather than timing out, and updates the logic to continue\r\nto use the current (not first) host if the first host was last called\r\nless than a minute ago.\r\n\r\nFinally, the DNS timeout test context is modified to reset the client\r\nand thread local variables before each test, rather than before all of\r\nthem; otherwise the timeout in the first test case causes the first\r\ncheck in the second test case to fail (since the client has already\r\nfallen back to the second host)"},"comment":{"url":"https://api.github.com/repos/algolia/algoliasearch-client-ruby/issues/comments/271965480","html_url":"https://github.com/algolia/algoliasearch-client-ruby/pull/162#issuecomment-271965480","issue_url":"https://api.github.com/repos/algolia/algoliasearch-client-ruby/issues/162","id":271965480,"user":{"login":"coveralls","id":2354108,"avatar_url":"https://avatars.githubusercontent.com/u/2354108?v=3","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2017-01-11T19:14:24Z","updated_at":"2017-01-11T19:14:24Z","body":"\n[![Coverage Status](https://coveralls.io/builds/9626185/badge)](https://coveralls.io/builds/9626185)\n\nCoverage decreased (-61.8%) to 31.452% when pulling **f230ad525cf5520fcb86c968961cfe9b1765ee76 on jstultz:dns-timeout** into **86b2afec6090564f7a75003c0d1ac6bcbbb0c628 on algolia:master**.\n"}}
{"actor":{"display_login":"coveralls"}}