{"action":"opened","number":2544,"pull_request":{"url":"https://api.github.com/repos/mperham/sidekiq/pulls/2544","id":44547730,"html_url":"https://github.com/mperham/sidekiq/pull/2544","diff_url":"https://github.com/mperham/sidekiq/pull/2544.diff","patch_url":"https://github.com/mperham/sidekiq/pull/2544.patch","issue_url":"https://api.github.com/repos/mperham/sidekiq/issues/2544","number":2544,"state":"open","locked":false,"title":"Map retry_in period to integer","user":{"login":"Bartuz","id":4388676,"avatar_url":"https://avatars.githubusercontent.com/u/4388676?v=3","gravatar_id":"","url":"https://api.github.com/users/Bartuz","html_url":"https://github.com/Bartuz","followers_url":"https://api.github.com/users/Bartuz/followers","following_url":"https://api.github.com/users/Bartuz/following{/other_user}","gists_url":"https://api.github.com/users/Bartuz/gists{/gist_id}","starred_url":"https://api.github.com/users/Bartuz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bartuz/subscriptions","organizations_url":"https://api.github.com/users/Bartuz/orgs","repos_url":"https://api.github.com/users/Bartuz/repos","events_url":"https://api.github.com/users/Bartuz/events{/privacy}","received_events_url":"https://api.github.com/users/Bartuz/received_events","type":"User","site_admin":false},"body":"According to [wiki](https://github.com/mperham/sidekiq/wiki/Error-Handling). The return value of the block must be an integer.\r\n\r\nHowever many users like to use 1.hour / 2.days / 34.seconds syntax from `Activesupport::Duration`.  All Activesupport::Duration instances can be mapped to integer with `to_i` method. Lets map it than!\r\n\r\n```\r\n # The current retry count is yielded. The return value of the block must be \r\n  # an integer. It is used as the delay, in seconds. \r\n  sidekiq_retry_in do |count|\r\n    10 * (count + 1) # (i.e. 10, 20, 30, 40)\r\n  end\r\n```","created_at":"2015-09-09T13:14:05Z","updated_at":"2015-09-09T13:14:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9786dbb89da73e64a0c64b18ed627ae7eeb3ab88","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mperham/sidekiq/pulls/2544/commits","review_comments_url":"https://api.github.com/repos/mperham/sidekiq/pulls/2544/comments","review_comment_url":"https://api.github.com/repos/mperham/sidekiq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mperham/sidekiq/issues/2544/comments","statuses_url":"https://api.github.com/repos/mperham/sidekiq/statuses/1885fcf5db9f7e3dc504e464971a3dbe652aa087","head":{"label":"Bartuz:patch-1","ref":"patch-1","sha":"1885fcf5db9f7e3dc504e464971a3dbe652aa087","user":{"login":"Bartuz","id":4388676,"avatar_url":"https://avatars.githubusercontent.com/u/4388676?v=3","gravatar_id":"","url":"https://api.github.com/users/Bartuz","html_url":"https://github.com/Bartuz","followers_url":"https://api.github.com/users/Bartuz/followers","following_url":"https://api.github.com/users/Bartuz/following{/other_user}","gists_url":"https://api.github.com/users/Bartuz/gists{/gist_id}","starred_url":"https://api.github.com/users/Bartuz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bartuz/subscriptions","organizations_url":"https://api.github.com/users/Bartuz/orgs","repos_url":"https://api.github.com/users/Bartuz/repos","events_url":"https://api.github.com/users/Bartuz/events{/privacy}","received_events_url":"https://api.github.com/users/Bartuz/received_events","type":"User","site_admin":false},"repo":{"id":42176821,"name":"sidekiq","full_name":"Bartuz/sidekiq","owner":{"login":"Bartuz","id":4388676,"avatar_url":"https://avatars.githubusercontent.com/u/4388676?v=3","gravatar_id":"","url":"https://api.github.com/users/Bartuz","html_url":"https://github.com/Bartuz","followers_url":"https://api.github.com/users/Bartuz/followers","following_url":"https://api.github.com/users/Bartuz/following{/other_user}","gists_url":"https://api.github.com/users/Bartuz/gists{/gist_id}","starred_url":"https://api.github.com/users/Bartuz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bartuz/subscriptions","organizations_url":"https://api.github.com/users/Bartuz/orgs","repos_url":"https://api.github.com/users/Bartuz/repos","events_url":"https://api.github.com/users/Bartuz/events{/privacy}","received_events_url":"https://api.github.com/users/Bartuz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Bartuz/sidekiq","description":"Simple, efficient background processing for Ruby","fork":true,"url":"https://api.github.com/repos/Bartuz/sidekiq","forks_url":"https://api.github.com/repos/Bartuz/sidekiq/forks","keys_url":"https://api.github.com/repos/Bartuz/sidekiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bartuz/sidekiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bartuz/sidekiq/teams","hooks_url":"https://api.github.com/repos/Bartuz/sidekiq/hooks","issue_events_url":"https://api.github.com/repos/Bartuz/sidekiq/issues/events{/number}","events_url":"https://api.github.com/repos/Bartuz/sidekiq/events","assignees_url":"https://api.github.com/repos/Bartuz/sidekiq/assignees{/user}","branches_url":"https://api.github.com/repos/Bartuz/sidekiq/branches{/branch}","tags_url":"https://api.github.com/repos/Bartuz/sidekiq/tags","blobs_url":"https://api.github.com/repos/Bartuz/sidekiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bartuz/sidekiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bartuz/sidekiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bartuz/sidekiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bartuz/sidekiq/statuses/{sha}","languages_url":"https://api.github.com/repos/Bartuz/sidekiq/languages","stargazers_url":"https://api.github.com/repos/Bartuz/sidekiq/stargazers","contributors_url":"https://api.github.com/repos/Bartuz/sidekiq/contributors","subscribers_url":"https://api.github.com/repos/Bartuz/sidekiq/subscribers","subscription_url":"https://api.github.com/repos/Bartuz/sidekiq/subscription","commits_url":"https://api.github.com/repos/Bartuz/sidekiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bartuz/sidekiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bartuz/sidekiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bartuz/sidekiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bartuz/sidekiq/contents/{+path}","compare_url":"https://api.github.com/repos/Bartuz/sidekiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bartuz/sidekiq/merges","archive_url":"https://api.github.com/repos/Bartuz/sidekiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bartuz/sidekiq/downloads","issues_url":"https://api.github.com/repos/Bartuz/sidekiq/issues{/number}","pulls_url":"https://api.github.com/repos/Bartuz/sidekiq/pulls{/number}","milestones_url":"https://api.github.com/repos/Bartuz/sidekiq/milestones{/number}","notifications_url":"https://api.github.com/repos/Bartuz/sidekiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bartuz/sidekiq/labels{/name}","releases_url":"https://api.github.com/repos/Bartuz/sidekiq/releases{/id}","created_at":"2015-09-09T12:25:11Z","updated_at":"2015-09-09T12:25:13Z","pushed_at":"2015-09-09T13:13:57Z","git_url":"git://github.com/Bartuz/sidekiq.git","ssh_url":"git@github.com:Bartuz/sidekiq.git","clone_url":"https://github.com/Bartuz/sidekiq.git","svn_url":"https://github.com/Bartuz/sidekiq","homepage":"http://sidekiq.org","size":15810,"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":"mperham:master","ref":"master","sha":"4154091ab04f236dce22dfa36c73043a71a78df6","user":{"login":"mperham","id":2911,"avatar_url":"https://avatars.githubusercontent.com/u/2911?v=3","gravatar_id":"","url":"https://api.github.com/users/mperham","html_url":"https://github.com/mperham","followers_url":"https://api.github.com/users/mperham/followers","following_url":"https://api.github.com/users/mperham/following{/other_user}","gists_url":"https://api.github.com/users/mperham/gists{/gist_id}","starred_url":"https://api.github.com/users/mperham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mperham/subscriptions","organizations_url":"https://api.github.com/users/mperham/orgs","repos_url":"https://api.github.com/users/mperham/repos","events_url":"https://api.github.com/users/mperham/events{/privacy}","received_events_url":"https://api.github.com/users/mperham/received_events","type":"User","site_admin":false},"repo":{"id":3195124,"name":"sidekiq","full_name":"mperham/sidekiq","owner":{"login":"mperham","id":2911,"avatar_url":"https://avatars.githubusercontent.com/u/2911?v=3","gravatar_id":"","url":"https://api.github.com/users/mperham","html_url":"https://github.com/mperham","followers_url":"https://api.github.com/users/mperham/followers","following_url":"https://api.github.com/users/mperham/following{/other_user}","gists_url":"https://api.github.com/users/mperham/gists{/gist_id}","starred_url":"https://api.github.com/users/mperham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mperham/subscriptions","organizations_url":"https://api.github.com/users/mperham/orgs","repos_url":"https://api.github.com/users/mperham/repos","events_url":"https://api.github.com/users/mperham/events{/privacy}","received_events_url":"https://api.github.com/users/mperham/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mperham/sidekiq","description":"Simple, efficient background processing for Ruby","fork":false,"url":"https://api.github.com/repos/mperham/sidekiq","forks_url":"https://api.github.com/repos/mperham/sidekiq/forks","keys_url":"https://api.github.com/repos/mperham/sidekiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mperham/sidekiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mperham/sidekiq/teams","hooks_url":"https://api.github.com/repos/mperham/sidekiq/hooks","issue_events_url":"https://api.github.com/repos/mperham/sidekiq/issues/events{/number}","events_url":"https://api.github.com/repos/mperham/sidekiq/events","assignees_url":"https://api.github.com/repos/mperham/sidekiq/assignees{/user}","branches_url":"https://api.github.com/repos/mperham/sidekiq/branches{/branch}","tags_url":"https://api.github.com/repos/mperham/sidekiq/tags","blobs_url":"https://api.github.com/repos/mperham/sidekiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mperham/sidekiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mperham/sidekiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/mperham/sidekiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mperham/sidekiq/statuses/{sha}","languages_url":"https://api.github.com/repos/mperham/sidekiq/languages","stargazers_url":"https://api.github.com/repos/mperham/sidekiq/stargazers","contributors_url":"https://api.github.com/repos/mperham/sidekiq/contributors","subscribers_url":"https://api.github.com/repos/mperham/sidekiq/subscribers","subscription_url":"https://api.github.com/repos/mperham/sidekiq/subscription","commits_url":"https://api.github.com/repos/mperham/sidekiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/mperham/sidekiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/mperham/sidekiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/mperham/sidekiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/mperham/sidekiq/contents/{+path}","compare_url":"https://api.github.com/repos/mperham/sidekiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mperham/sidekiq/merges","archive_url":"https://api.github.com/repos/mperham/sidekiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mperham/sidekiq/downloads","issues_url":"https://api.github.com/repos/mperham/sidekiq/issues{/number}","pulls_url":"https://api.github.com/repos/mperham/sidekiq/pulls{/number}","milestones_url":"https://api.github.com/repos/mperham/sidekiq/milestones{/number}","notifications_url":"https://api.github.com/repos/mperham/sidekiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mperham/sidekiq/labels{/name}","releases_url":"https://api.github.com/repos/mperham/sidekiq/releases{/id}","created_at":"2012-01-16T23:17:27Z","updated_at":"2015-09-09T08:30:47Z","pushed_at":"2015-09-09T13:14:06Z","git_url":"git://github.com/mperham/sidekiq.git","ssh_url":"git@github.com:mperham/sidekiq.git","clone_url":"https://github.com/mperham/sidekiq.git","svn_url":"https://github.com/mperham/sidekiq","homepage":"http://sidekiq.org","size":15810,"stargazers_count":5429,"watchers_count":5429,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":894,"mirror_url":null,"open_issues_count":22,"forks":894,"open_issues":22,"watchers":5429,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mperham/sidekiq/pulls/2544"},"html":{"href":"https://github.com/mperham/sidekiq/pull/2544"},"issue":{"href":"https://api.github.com/repos/mperham/sidekiq/issues/2544"},"comments":{"href":"https://api.github.com/repos/mperham/sidekiq/issues/2544/comments"},"review_comments":{"href":"https://api.github.com/repos/mperham/sidekiq/pulls/2544/comments"},"review_comment":{"href":"https://api.github.com/repos/mperham/sidekiq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mperham/sidekiq/pulls/2544/commits"},"statuses":{"href":"https://api.github.com/repos/mperham/sidekiq/statuses/1885fcf5db9f7e3dc504e464971a3dbe652aa087"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":1,"deletions":1,"changed_files":1}}