{"action":"created","issue":{"url":"https://api.github.com/repos/phstc/shoryuken/issues/187","repository_url":"https://api.github.com/repos/phstc/shoryuken","labels_url":"https://api.github.com/repos/phstc/shoryuken/issues/187/labels{/name}","comments_url":"https://api.github.com/repos/phstc/shoryuken/issues/187/comments","events_url":"https://api.github.com/repos/phstc/shoryuken/issues/187/events","html_url":"https://github.com/phstc/shoryuken/issues/187","id":140021863,"number":187,"title":"Job timeout option","user":{"login":"mariokostelac","id":1917451,"avatar_url":"https://avatars.githubusercontent.com/u/1917451?v=3","gravatar_id":"","url":"https://api.github.com/users/mariokostelac","html_url":"https://github.com/mariokostelac","followers_url":"https://api.github.com/users/mariokostelac/followers","following_url":"https://api.github.com/users/mariokostelac/following{/other_user}","gists_url":"https://api.github.com/users/mariokostelac/gists{/gist_id}","starred_url":"https://api.github.com/users/mariokostelac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariokostelac/subscriptions","organizations_url":"https://api.github.com/users/mariokostelac/orgs","repos_url":"https://api.github.com/users/mariokostelac/repos","events_url":"https://api.github.com/users/mariokostelac/events{/privacy}","received_events_url":"https://api.github.com/users/mariokostelac/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-03-10T21:58:40Z","updated_at":"2016-04-21T07:05:31Z","closed_at":"2016-03-15T13:16:40Z","body":"Is there any option to define a timeout on job itself?\r\nIf not, is there any reason why we do not want to have that option?\r\n\r\nI know visibility timeout helps here, but it does not kill the job. If we have N workers, visibility timeout T and job that lasts for (N + 1) * T, after T we have the whole fleet running the same task.\r\nOf course, a task could run forever, too."},"comment":{"url":"https://api.github.com/repos/phstc/shoryuken/issues/comments/212775285","html_url":"https://github.com/phstc/shoryuken/issues/187#issuecomment-212775285","issue_url":"https://api.github.com/repos/phstc/shoryuken/issues/187","id":212775285,"user":{"login":"jrgns","id":170848,"avatar_url":"https://avatars.githubusercontent.com/u/170848?v=3","gravatar_id":"","url":"https://api.github.com/users/jrgns","html_url":"https://github.com/jrgns","followers_url":"https://api.github.com/users/jrgns/followers","following_url":"https://api.github.com/users/jrgns/following{/other_user}","gists_url":"https://api.github.com/users/jrgns/gists{/gist_id}","starred_url":"https://api.github.com/users/jrgns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrgns/subscriptions","organizations_url":"https://api.github.com/users/jrgns/orgs","repos_url":"https://api.github.com/users/jrgns/repos","events_url":"https://api.github.com/users/jrgns/events{/privacy}","received_events_url":"https://api.github.com/users/jrgns/received_events","type":"User","site_admin":false},"created_at":"2016-04-21T07:05:31Z","updated_at":"2016-04-21T07:05:31Z","body":"I won't mind having a hard timeout on a job as well, but it is relatively easy to add it on a per worker basis:\r\n\r\n```ruby\r\nrequire 'shoryuken'\r\nrequire 'timeout'\r\n\r\nclass Worker\r\n  include Shoryuken::Worker\r\n\r\n  def perform\r\n    Timeout::timeout(30) {\r\n      # Perform potentially long running code here\r\n    }\r\n  end\r\nend\r\n```\r\n"}}