{"action":"created","comment":{"url":"https://api.github.com/repos/jondot/sneakers/pulls/comments/28780639","id":28780639,"diff_hunk":"@@ -165,9 +165,14 @@ def failure_count(headers)\n         if headers.nil? || headers['x-death'].nil?\n           0\n         else\n-          headers['x-death'].select do |x_death|\n+          x_death_array = headers['x-death'].select do |x_death|\n             x_death['queue'] == @worker_queue_name\n-          end.count\n+          end\n+          if x_death_array.count != 1\n+            x_death_array.count\n+          else\n+            x_death_array.first['count'] || 1","path":"lib/sneakers/handlers/maxretry.rb","position":12,"original_position":12,"commit_id":"11cdcbc4eac6dc106794de2ba54e515b51a346e0","original_commit_id":"11cdcbc4eac6dc106794de2ba54e515b51a346e0","user":{"login":"justin-yesware","id":3134864,"avatar_url":"https://avatars.githubusercontent.com/u/3134864?v=3","gravatar_id":"","url":"https://api.github.com/users/justin-yesware","html_url":"https://github.com/justin-yesware","followers_url":"https://api.github.com/users/justin-yesware/followers","following_url":"https://api.github.com/users/justin-yesware/following{/other_user}","gists_url":"https://api.github.com/users/justin-yesware/gists{/gist_id}","starred_url":"https://api.github.com/users/justin-yesware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justin-yesware/subscriptions","organizations_url":"https://api.github.com/users/justin-yesware/orgs","repos_url":"https://api.github.com/users/justin-yesware/repos","events_url":"https://api.github.com/users/justin-yesware/events{/privacy}","received_events_url":"https://api.github.com/users/justin-yesware/received_events","type":"User","site_admin":false},"body":"Yep, gotcha. Sorry I missed that earlier.","created_at":"2015-04-21T14:07:10Z","updated_at":"2015-04-21T14:07:10Z","html_url":"https://github.com/jondot/sneakers/pull/120#discussion_r28780639","pull_request_url":"https://api.github.com/repos/jondot/sneakers/pulls/120","_links":{"self":{"href":"https://api.github.com/repos/jondot/sneakers/pulls/comments/28780639"},"html":{"href":"https://github.com/jondot/sneakers/pull/120#discussion_r28780639"},"pull_request":{"href":"https://api.github.com/repos/jondot/sneakers/pulls/120"}}},"pull_request":{"url":"https://api.github.com/repos/jondot/sneakers/pulls/120","id":33697564,"html_url":"https://github.com/jondot/sneakers/pull/120","diff_url":"https://github.com/jondot/sneakers/pull/120.diff","patch_url":"https://github.com/jondot/sneakers/pull/120.patch","issue_url":"https://api.github.com/repos/jondot/sneakers/issues/120","number":120,"state":"open","locked":false,"title":"Fix max retry count for new version of RabbitMQ x-death format","user":{"login":"jaronkk","id":127832,"avatar_url":"https://avatars.githubusercontent.com/u/127832?v=3","gravatar_id":"","url":"https://api.github.com/users/jaronkk","html_url":"https://github.com/jaronkk","followers_url":"https://api.github.com/users/jaronkk/followers","following_url":"https://api.github.com/users/jaronkk/following{/other_user}","gists_url":"https://api.github.com/users/jaronkk/gists{/gist_id}","starred_url":"https://api.github.com/users/jaronkk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaronkk/subscriptions","organizations_url":"https://api.github.com/users/jaronkk/orgs","repos_url":"https://api.github.com/users/jaronkk/repos","events_url":"https://api.github.com/users/jaronkk/events{/privacy}","received_events_url":"https://api.github.com/users/jaronkk/received_events","type":"User","site_admin":false},"body":"As of March 26, RabbitMQ consolidated the x-death header to have only one entry per queue.  A new \"count\" value was added to track the number of times it's been in a queue. \r\n\r\nI've adjusted the failure_count method so it should work for both the old and new formats for the x-death header.\r\n\r\nhttps://github.com/rabbitmq/rabbitmq-server/issues/78\r\nhttps://github.com/rabbitmq/rabbitmq-server/pull/79","created_at":"2015-04-20T19:26:18Z","updated_at":"2015-04-21T14:07:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8867f87e59166577bf37ecd912de3dd35d07432f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jondot/sneakers/pulls/120/commits","review_comments_url":"https://api.github.com/repos/jondot/sneakers/pulls/120/comments","review_comment_url":"https://api.github.com/repos/jondot/sneakers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jondot/sneakers/issues/120/comments","statuses_url":"https://api.github.com/repos/jondot/sneakers/statuses/11cdcbc4eac6dc106794de2ba54e515b51a346e0","head":{"label":"jaronkk:max-retry-count","ref":"max-retry-count","sha":"11cdcbc4eac6dc106794de2ba54e515b51a346e0","user":{"login":"jaronkk","id":127832,"avatar_url":"https://avatars.githubusercontent.com/u/127832?v=3","gravatar_id":"","url":"https://api.github.com/users/jaronkk","html_url":"https://github.com/jaronkk","followers_url":"https://api.github.com/users/jaronkk/followers","following_url":"https://api.github.com/users/jaronkk/following{/other_user}","gists_url":"https://api.github.com/users/jaronkk/gists{/gist_id}","starred_url":"https://api.github.com/users/jaronkk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaronkk/subscriptions","organizations_url":"https://api.github.com/users/jaronkk/orgs","repos_url":"https://api.github.com/users/jaronkk/repos","events_url":"https://api.github.com/users/jaronkk/events{/privacy}","received_events_url":"https://api.github.com/users/jaronkk/received_events","type":"User","site_admin":false},"repo":{"id":34276557,"name":"sneakers","full_name":"jaronkk/sneakers","owner":{"login":"jaronkk","id":127832,"avatar_url":"https://avatars.githubusercontent.com/u/127832?v=3","gravatar_id":"","url":"https://api.github.com/users/jaronkk","html_url":"https://github.com/jaronkk","followers_url":"https://api.github.com/users/jaronkk/followers","following_url":"https://api.github.com/users/jaronkk/following{/other_user}","gists_url":"https://api.github.com/users/jaronkk/gists{/gist_id}","starred_url":"https://api.github.com/users/jaronkk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaronkk/subscriptions","organizations_url":"https://api.github.com/users/jaronkk/orgs","repos_url":"https://api.github.com/users/jaronkk/repos","events_url":"https://api.github.com/users/jaronkk/events{/privacy}","received_events_url":"https://api.github.com/users/jaronkk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jaronkk/sneakers","description":"A fast background processing framework for Ruby and RabbitMQ","fork":true,"url":"https://api.github.com/repos/jaronkk/sneakers","forks_url":"https://api.github.com/repos/jaronkk/sneakers/forks","keys_url":"https://api.github.com/repos/jaronkk/sneakers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jaronkk/sneakers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jaronkk/sneakers/teams","hooks_url":"https://api.github.com/repos/jaronkk/sneakers/hooks","issue_events_url":"https://api.github.com/repos/jaronkk/sneakers/issues/events{/number}","events_url":"https://api.github.com/repos/jaronkk/sneakers/events","assignees_url":"https://api.github.com/repos/jaronkk/sneakers/assignees{/user}","branches_url":"https://api.github.com/repos/jaronkk/sneakers/branches{/branch}","tags_url":"https://api.github.com/repos/jaronkk/sneakers/tags","blobs_url":"https://api.github.com/repos/jaronkk/sneakers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jaronkk/sneakers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jaronkk/sneakers/git/refs{/sha}","trees_url":"https://api.github.com/repos/jaronkk/sneakers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jaronkk/sneakers/statuses/{sha}","languages_url":"https://api.github.com/repos/jaronkk/sneakers/languages","stargazers_url":"https://api.github.com/repos/jaronkk/sneakers/stargazers","contributors_url":"https://api.github.com/repos/jaronkk/sneakers/contributors","subscribers_url":"https://api.github.com/repos/jaronkk/sneakers/subscribers","subscription_url":"https://api.github.com/repos/jaronkk/sneakers/subscription","commits_url":"https://api.github.com/repos/jaronkk/sneakers/commits{/sha}","git_commits_url":"https://api.github.com/repos/jaronkk/sneakers/git/commits{/sha}","comments_url":"https://api.github.com/repos/jaronkk/sneakers/comments{/number}","issue_comment_url":"https://api.github.com/repos/jaronkk/sneakers/issues/comments{/number}","contents_url":"https://api.github.com/repos/jaronkk/sneakers/contents/{+path}","compare_url":"https://api.github.com/repos/jaronkk/sneakers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jaronkk/sneakers/merges","archive_url":"https://api.github.com/repos/jaronkk/sneakers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jaronkk/sneakers/downloads","issues_url":"https://api.github.com/repos/jaronkk/sneakers/issues{/number}","pulls_url":"https://api.github.com/repos/jaronkk/sneakers/pulls{/number}","milestones_url":"https://api.github.com/repos/jaronkk/sneakers/milestones{/number}","notifications_url":"https://api.github.com/repos/jaronkk/sneakers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jaronkk/sneakers/labels{/name}","releases_url":"https://api.github.com/repos/jaronkk/sneakers/releases{/id}","created_at":"2015-04-20T17:51:05Z","updated_at":"2015-04-20T17:51:05Z","pushed_at":"2015-04-20T19:21:01Z","git_url":"git://github.com/jaronkk/sneakers.git","ssh_url":"git@github.com:jaronkk/sneakers.git","clone_url":"https://github.com/jaronkk/sneakers.git","svn_url":"https://github.com/jaronkk/sneakers","homepage":"http://sneakers.io","size":2303,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jondot:master","ref":"master","sha":"99e7863413d905d18512cbcde0c85695d7898be5","user":{"login":"jondot","id":83390,"avatar_url":"https://avatars.githubusercontent.com/u/83390?v=3","gravatar_id":"","url":"https://api.github.com/users/jondot","html_url":"https://github.com/jondot","followers_url":"https://api.github.com/users/jondot/followers","following_url":"https://api.github.com/users/jondot/following{/other_user}","gists_url":"https://api.github.com/users/jondot/gists{/gist_id}","starred_url":"https://api.github.com/users/jondot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jondot/subscriptions","organizations_url":"https://api.github.com/users/jondot/orgs","repos_url":"https://api.github.com/users/jondot/repos","events_url":"https://api.github.com/users/jondot/events{/privacy}","received_events_url":"https://api.github.com/users/jondot/received_events","type":"User","site_admin":false},"repo":{"id":13441956,"name":"sneakers","full_name":"jondot/sneakers","owner":{"login":"jondot","id":83390,"avatar_url":"https://avatars.githubusercontent.com/u/83390?v=3","gravatar_id":"","url":"https://api.github.com/users/jondot","html_url":"https://github.com/jondot","followers_url":"https://api.github.com/users/jondot/followers","following_url":"https://api.github.com/users/jondot/following{/other_user}","gists_url":"https://api.github.com/users/jondot/gists{/gist_id}","starred_url":"https://api.github.com/users/jondot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jondot/subscriptions","organizations_url":"https://api.github.com/users/jondot/orgs","repos_url":"https://api.github.com/users/jondot/repos","events_url":"https://api.github.com/users/jondot/events{/privacy}","received_events_url":"https://api.github.com/users/jondot/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jondot/sneakers","description":"A fast background processing framework for Ruby and RabbitMQ","fork":false,"url":"https://api.github.com/repos/jondot/sneakers","forks_url":"https://api.github.com/repos/jondot/sneakers/forks","keys_url":"https://api.github.com/repos/jondot/sneakers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jondot/sneakers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jondot/sneakers/teams","hooks_url":"https://api.github.com/repos/jondot/sneakers/hooks","issue_events_url":"https://api.github.com/repos/jondot/sneakers/issues/events{/number}","events_url":"https://api.github.com/repos/jondot/sneakers/events","assignees_url":"https://api.github.com/repos/jondot/sneakers/assignees{/user}","branches_url":"https://api.github.com/repos/jondot/sneakers/branches{/branch}","tags_url":"https://api.github.com/repos/jondot/sneakers/tags","blobs_url":"https://api.github.com/repos/jondot/sneakers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jondot/sneakers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jondot/sneakers/git/refs{/sha}","trees_url":"https://api.github.com/repos/jondot/sneakers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jondot/sneakers/statuses/{sha}","languages_url":"https://api.github.com/repos/jondot/sneakers/languages","stargazers_url":"https://api.github.com/repos/jondot/sneakers/stargazers","contributors_url":"https://api.github.com/repos/jondot/sneakers/contributors","subscribers_url":"https://api.github.com/repos/jondot/sneakers/subscribers","subscription_url":"https://api.github.com/repos/jondot/sneakers/subscription","commits_url":"https://api.github.com/repos/jondot/sneakers/commits{/sha}","git_commits_url":"https://api.github.com/repos/jondot/sneakers/git/commits{/sha}","comments_url":"https://api.github.com/repos/jondot/sneakers/comments{/number}","issue_comment_url":"https://api.github.com/repos/jondot/sneakers/issues/comments{/number}","contents_url":"https://api.github.com/repos/jondot/sneakers/contents/{+path}","compare_url":"https://api.github.com/repos/jondot/sneakers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jondot/sneakers/merges","archive_url":"https://api.github.com/repos/jondot/sneakers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jondot/sneakers/downloads","issues_url":"https://api.github.com/repos/jondot/sneakers/issues{/number}","pulls_url":"https://api.github.com/repos/jondot/sneakers/pulls{/number}","milestones_url":"https://api.github.com/repos/jondot/sneakers/milestones{/number}","notifications_url":"https://api.github.com/repos/jondot/sneakers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jondot/sneakers/labels{/name}","releases_url":"https://api.github.com/repos/jondot/sneakers/releases{/id}","created_at":"2013-10-09T12:41:36Z","updated_at":"2015-04-21T10:12:12Z","pushed_at":"2015-04-20T19:26:18Z","git_url":"git://github.com/jondot/sneakers.git","ssh_url":"git@github.com:jondot/sneakers.git","clone_url":"https://github.com/jondot/sneakers.git","svn_url":"https://github.com/jondot/sneakers","homepage":"http://sneakers.io","size":2303,"stargazers_count":978,"watchers_count":978,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":101,"mirror_url":null,"open_issues_count":29,"forks":101,"open_issues":29,"watchers":978,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jondot/sneakers/pulls/120"},"html":{"href":"https://github.com/jondot/sneakers/pull/120"},"issue":{"href":"https://api.github.com/repos/jondot/sneakers/issues/120"},"comments":{"href":"https://api.github.com/repos/jondot/sneakers/issues/120/comments"},"review_comments":{"href":"https://api.github.com/repos/jondot/sneakers/pulls/120/comments"},"review_comment":{"href":"https://api.github.com/repos/jondot/sneakers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jondot/sneakers/pulls/120/commits"},"statuses":{"href":"https://api.github.com/repos/jondot/sneakers/statuses/11cdcbc4eac6dc106794de2ba54e515b51a346e0"}}}}