{"action":"created","comment":{"url":"https://api.github.com/repos/ankane/distribute_reads/pulls/comments/232159472","pull_request_review_id":173294826,"id":232159472,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMjE1OTQ3Mg==","diff_hunk":"@@ -5,7 +5,7 @@\n require \"active_record\"\n require \"active_job\"\n \n-ActiveJob::Base.logger.level = :warn\n+ActiveJob::Base.logger.level = 1","path":"test/test_helper.rb","position":5,"original_position":5,"commit_id":"1b6a0d1d2229617c336fe9f86a45d915479aed31","original_commit_id":"251323ba53578a47846def6edd09ac1567e94c90","user":{"login":"mmontagna","id":6549664,"node_id":"MDQ6VXNlcjY1NDk2NjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/6549664?v=4","gravatar_id":"","url":"https://api.github.com/users/mmontagna","html_url":"https://github.com/mmontagna","followers_url":"https://api.github.com/users/mmontagna/followers","following_url":"https://api.github.com/users/mmontagna/following{/other_user}","gists_url":"https://api.github.com/users/mmontagna/gists{/gist_id}","starred_url":"https://api.github.com/users/mmontagna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmontagna/subscriptions","organizations_url":"https://api.github.com/users/mmontagna/orgs","repos_url":"https://api.github.com/users/mmontagna/repos","events_url":"https://api.github.com/users/mmontagna/events{/privacy}","received_events_url":"https://api.github.com/users/mmontagna/received_events","type":"User","site_admin":false},"body":"I changed this because I got an `ArgumentError: comparison of Fixnum with :warn failed` while running the test suite. Which lead me to believe that the log level should be an integer.\r\n\r\nThough it may have just been because I have a different version of ActiveJob or ruby (probably older). I can change it back if needed.","created_at":"2018-11-09T07:15:26Z","updated_at":"2018-11-09T07:15:27Z","html_url":"https://github.com/ankane/distribute_reads/pull/15#discussion_r232159472","pull_request_url":"https://api.github.com/repos/ankane/distribute_reads/pulls/15","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/ankane/distribute_reads/pulls/comments/232159472"},"html":{"href":"https://github.com/ankane/distribute_reads/pull/15#discussion_r232159472"},"pull_request":{"href":"https://api.github.com/repos/ankane/distribute_reads/pulls/15"}},"in_reply_to_id":232135598},"pull_request":{"url":"https://api.github.com/repos/ankane/distribute_reads/pulls/15","id":228548421,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4NTQ4NDIx","html_url":"https://github.com/ankane/distribute_reads/pull/15","diff_url":"https://github.com/ankane/distribute_reads/pull/15.diff","patch_url":"https://github.com/ankane/distribute_reads/pull/15.patch","issue_url":"https://api.github.com/repos/ankane/distribute_reads/issues/15","number":15,"state":"open","locked":false,"title":"Add option to log replica -> master failover events","user":{"login":"mmontagna","id":6549664,"node_id":"MDQ6VXNlcjY1NDk2NjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/6549664?v=4","gravatar_id":"","url":"https://api.github.com/users/mmontagna","html_url":"https://github.com/mmontagna","followers_url":"https://api.github.com/users/mmontagna/followers","following_url":"https://api.github.com/users/mmontagna/following{/other_user}","gists_url":"https://api.github.com/users/mmontagna/gists{/gist_id}","starred_url":"https://api.github.com/users/mmontagna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmontagna/subscriptions","organizations_url":"https://api.github.com/users/mmontagna/orgs","repos_url":"https://api.github.com/users/mmontagna/repos","events_url":"https://api.github.com/users/mmontagna/events{/privacy}","received_events_url":"https://api.github.com/users/mmontagna/received_events","type":"User","site_admin":false},"body":"Would you be open to a PR to add the option to log warnings when applications using read failover to the primary DB while executing a distribute_reads block?\r\n\r\nThis PR is a first crack at it. Let me know if I'm on the right track, and if you'd be open to supporting this.\r\n\r\n\r\nUsage would be like:\r\n```\r\n      distribute_reads(replica: true, log_failover: true) do\r\n        some query\r\n      end\r\n```\r\n\r\nLog msg when falling back to primary DB:\r\n`No replicas available. Falling back to master pool.`","created_at":"2018-11-06T01:37:14Z","updated_at":"2018-11-09T07:15:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b7168bb621d6d57108334959e464fb23b5693da","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1121426454,"node_id":"MDU6TGFiZWwxMTIxNDI2NDU0","url":"https://api.github.com/repos/ankane/distribute_reads/labels/awaiting%20response","name":"awaiting response","color":"4baab7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ankane/distribute_reads/pulls/15/commits","review_comments_url":"https://api.github.com/repos/ankane/distribute_reads/pulls/15/comments","review_comment_url":"https://api.github.com/repos/ankane/distribute_reads/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ankane/distribute_reads/issues/15/comments","statuses_url":"https://api.github.com/repos/ankane/distribute_reads/statuses/1b6a0d1d2229617c336fe9f86a45d915479aed31","head":{"label":"mmontagna:master","ref":"master","sha":"1b6a0d1d2229617c336fe9f86a45d915479aed31","user":{"login":"mmontagna","id":6549664,"node_id":"MDQ6VXNlcjY1NDk2NjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/6549664?v=4","gravatar_id":"","url":"https://api.github.com/users/mmontagna","html_url":"https://github.com/mmontagna","followers_url":"https://api.github.com/users/mmontagna/followers","following_url":"https://api.github.com/users/mmontagna/following{/other_user}","gists_url":"https://api.github.com/users/mmontagna/gists{/gist_id}","starred_url":"https://api.github.com/users/mmontagna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmontagna/subscriptions","organizations_url":"https://api.github.com/users/mmontagna/orgs","repos_url":"https://api.github.com/users/mmontagna/repos","events_url":"https://api.github.com/users/mmontagna/events{/privacy}","received_events_url":"https://api.github.com/users/mmontagna/received_events","type":"User","site_admin":false},"repo":{"id":155508775,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU1MDg3NzU=","name":"distribute_reads","full_name":"mmontagna/distribute_reads","private":false,"owner":{"login":"mmontagna","id":6549664,"node_id":"MDQ6VXNlcjY1NDk2NjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/6549664?v=4","gravatar_id":"","url":"https://api.github.com/users/mmontagna","html_url":"https://github.com/mmontagna","followers_url":"https://api.github.com/users/mmontagna/followers","following_url":"https://api.github.com/users/mmontagna/following{/other_user}","gists_url":"https://api.github.com/users/mmontagna/gists{/gist_id}","starred_url":"https://api.github.com/users/mmontagna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmontagna/subscriptions","organizations_url":"https://api.github.com/users/mmontagna/orgs","repos_url":"https://api.github.com/users/mmontagna/repos","events_url":"https://api.github.com/users/mmontagna/events{/privacy}","received_events_url":"https://api.github.com/users/mmontagna/received_events","type":"User","site_admin":false},"html_url":"https://github.com/mmontagna/distribute_reads","description":"Scale database reads to replicas in Rails","fork":true,"url":"https://api.github.com/repos/mmontagna/distribute_reads","forks_url":"https://api.github.com/repos/mmontagna/distribute_reads/forks","keys_url":"https://api.github.com/repos/mmontagna/distribute_reads/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mmontagna/distribute_reads/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mmontagna/distribute_reads/teams","hooks_url":"https://api.github.com/repos/mmontagna/distribute_reads/hooks","issue_events_url":"https://api.github.com/repos/mmontagna/distribute_reads/issues/events{/number}","events_url":"https://api.github.com/repos/mmontagna/distribute_reads/events","assignees_url":"https://api.github.com/repos/mmontagna/distribute_reads/assignees{/user}","branches_url":"https://api.github.com/repos/mmontagna/distribute_reads/branches{/branch}","tags_url":"https://api.github.com/repos/mmontagna/distribute_reads/tags","blobs_url":"https://api.github.com/repos/mmontagna/distribute_reads/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mmontagna/distribute_reads/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mmontagna/distribute_reads/git/refs{/sha}","trees_url":"https://api.github.com/repos/mmontagna/distribute_reads/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mmontagna/distribute_reads/statuses/{sha}","languages_url":"https://api.github.com/repos/mmontagna/distribute_reads/languages","stargazers_url":"https://api.github.com/repos/mmontagna/distribute_reads/stargazers","contributors_url":"https://api.github.com/repos/mmontagna/distribute_reads/contributors","subscribers_url":"https://api.github.com/repos/mmontagna/distribute_reads/subscribers","subscription_url":"https://api.github.com/repos/mmontagna/distribute_reads/subscription","commits_url":"https://api.github.com/repos/mmontagna/distribute_reads/commits{/sha}","git_commits_url":"https://api.github.com/repos/mmontagna/distribute_reads/git/commits{/sha}","comments_url":"https://api.github.com/repos/mmontagna/distribute_reads/comments{/number}","issue_comment_url":"https://api.github.com/repos/mmontagna/distribute_reads/issues/comments{/number}","contents_url":"https://api.github.com/repos/mmontagna/distribute_reads/contents/{+path}","compare_url":"https://api.github.com/repos/mmontagna/distribute_reads/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mmontagna/distribute_reads/merges","archive_url":"https://api.github.com/repos/mmontagna/distribute_reads/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mmontagna/distribute_reads/downloads","issues_url":"https://api.github.com/repos/mmontagna/distribute_reads/issues{/number}","pulls_url":"https://api.github.com/repos/mmontagna/distribute_reads/pulls{/number}","milestones_url":"https://api.github.com/repos/mmontagna/distribute_reads/milestones{/number}","notifications_url":"https://api.github.com/repos/mmontagna/distribute_reads/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mmontagna/distribute_reads/labels{/name}","releases_url":"https://api.github.com/repos/mmontagna/distribute_reads/releases{/id}","deployments_url":"https://api.github.com/repos/mmontagna/distribute_reads/deployments","created_at":"2018-10-31T06:20:43Z","updated_at":"2018-11-09T07:05:32Z","pushed_at":"2018-11-09T07:05:31Z","git_url":"git://github.com/mmontagna/distribute_reads.git","ssh_url":"git@github.com:mmontagna/distribute_reads.git","clone_url":"https://github.com/mmontagna/distribute_reads.git","svn_url":"https://github.com/mmontagna/distribute_reads","homepage":null,"size":63,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ankane:master","ref":"master","sha":"a95f3c576132d6bf73cddfaf2bd600b5b8c79a1c","user":{"login":"ankane","id":220358,"node_id":"MDQ6VXNlcjIyMDM1OA==","avatar_url":"https://avatars3.githubusercontent.com/u/220358?v=4","gravatar_id":"","url":"https://api.github.com/users/ankane","html_url":"https://github.com/ankane","followers_url":"https://api.github.com/users/ankane/followers","following_url":"https://api.github.com/users/ankane/following{/other_user}","gists_url":"https://api.github.com/users/ankane/gists{/gist_id}","starred_url":"https://api.github.com/users/ankane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ankane/subscriptions","organizations_url":"https://api.github.com/users/ankane/orgs","repos_url":"https://api.github.com/users/ankane/repos","events_url":"https://api.github.com/users/ankane/events{/privacy}","received_events_url":"https://api.github.com/users/ankane/received_events","type":"User","site_admin":false},"repo":{"id":86281388,"node_id":"MDEwOlJlcG9zaXRvcnk4NjI4MTM4OA==","name":"distribute_reads","full_name":"ankane/distribute_reads","private":false,"owner":{"login":"ankane","id":220358,"node_id":"MDQ6VXNlcjIyMDM1OA==","avatar_url":"https://avatars3.githubusercontent.com/u/220358?v=4","gravatar_id":"","url":"https://api.github.com/users/ankane","html_url":"https://github.com/ankane","followers_url":"https://api.github.com/users/ankane/followers","following_url":"https://api.github.com/users/ankane/following{/other_user}","gists_url":"https://api.github.com/users/ankane/gists{/gist_id}","starred_url":"https://api.github.com/users/ankane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ankane/subscriptions","organizations_url":"https://api.github.com/users/ankane/orgs","repos_url":"https://api.github.com/users/ankane/repos","events_url":"https://api.github.com/users/ankane/events{/privacy}","received_events_url":"https://api.github.com/users/ankane/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ankane/distribute_reads","description":"Scale database reads to replicas in Rails","fork":false,"url":"https://api.github.com/repos/ankane/distribute_reads","forks_url":"https://api.github.com/repos/ankane/distribute_reads/forks","keys_url":"https://api.github.com/repos/ankane/distribute_reads/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ankane/distribute_reads/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ankane/distribute_reads/teams","hooks_url":"https://api.github.com/repos/ankane/distribute_reads/hooks","issue_events_url":"https://api.github.com/repos/ankane/distribute_reads/issues/events{/number}","events_url":"https://api.github.com/repos/ankane/distribute_reads/events","assignees_url":"https://api.github.com/repos/ankane/distribute_reads/assignees{/user}","branches_url":"https://api.github.com/repos/ankane/distribute_reads/branches{/branch}","tags_url":"https://api.github.com/repos/ankane/distribute_reads/tags","blobs_url":"https://api.github.com/repos/ankane/distribute_reads/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ankane/distribute_reads/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ankane/distribute_reads/git/refs{/sha}","trees_url":"https://api.github.com/repos/ankane/distribute_reads/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ankane/distribute_reads/statuses/{sha}","languages_url":"https://api.github.com/repos/ankane/distribute_reads/languages","stargazers_url":"https://api.github.com/repos/ankane/distribute_reads/stargazers","contributors_url":"https://api.github.com/repos/ankane/distribute_reads/contributors","subscribers_url":"https://api.github.com/repos/ankane/distribute_reads/subscribers","subscription_url":"https://api.github.com/repos/ankane/distribute_reads/subscription","commits_url":"https://api.github.com/repos/ankane/distribute_reads/commits{/sha}","git_commits_url":"https://api.github.com/repos/ankane/distribute_reads/git/commits{/sha}","comments_url":"https://api.github.com/repos/ankane/distribute_reads/comments{/number}","issue_comment_url":"https://api.github.com/repos/ankane/distribute_reads/issues/comments{/number}","contents_url":"https://api.github.com/repos/ankane/distribute_reads/contents/{+path}","compare_url":"https://api.github.com/repos/ankane/distribute_reads/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ankane/distribute_reads/merges","archive_url":"https://api.github.com/repos/ankane/distribute_reads/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ankane/distribute_reads/downloads","issues_url":"https://api.github.com/repos/ankane/distribute_reads/issues{/number}","pulls_url":"https://api.github.com/repos/ankane/distribute_reads/pulls{/number}","milestones_url":"https://api.github.com/repos/ankane/distribute_reads/milestones{/number}","notifications_url":"https://api.github.com/repos/ankane/distribute_reads/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ankane/distribute_reads/labels{/name}","releases_url":"https://api.github.com/repos/ankane/distribute_reads/releases{/id}","deployments_url":"https://api.github.com/repos/ankane/distribute_reads/deployments","created_at":"2017-03-27T02:15:24Z","updated_at":"2018-11-08T05:20:30Z","pushed_at":"2018-11-09T07:05:32Z","git_url":"git://github.com/ankane/distribute_reads.git","ssh_url":"git@github.com:ankane/distribute_reads.git","clone_url":"https://github.com/ankane/distribute_reads.git","svn_url":"https://github.com/ankane/distribute_reads","homepage":null,"size":63,"stargazers_count":134,"watchers_count":134,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":12,"open_issues":1,"watchers":134,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ankane/distribute_reads/pulls/15"},"html":{"href":"https://github.com/ankane/distribute_reads/pull/15"},"issue":{"href":"https://api.github.com/repos/ankane/distribute_reads/issues/15"},"comments":{"href":"https://api.github.com/repos/ankane/distribute_reads/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/ankane/distribute_reads/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/ankane/distribute_reads/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ankane/distribute_reads/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/ankane/distribute_reads/statuses/1b6a0d1d2229617c336fe9f86a45d915479aed31"}},"author_association":"NONE"}}
{"actor":{"display_login":"mmontagna"}}