{"action":"created","comment":{"url":"https://api.github.com/repos/Shopify/resque/pulls/comments/69570169","id":69570169,"diff_hunk":"@@ -269,11 +234,31 @@ def work(interval = 5.0, &block)\n \n       unregister_worker\n     rescue Exception => exception\n-      unless exception.class == SystemExit && !@child && run_at_exit_hooks\n-        log_with_severity :error, \"Failed to start worker : #{exception.inspect}\"\n+      return if exception.class == SystemExit && !@child && run_at_exit_hooks\n+      log_with_severity :error, \"Failed to start worker : #{exception.inspect}\"\n+      unregister_worker(exception)\n+    end\n+\n+    def work_one_job(job = nil, &block)\n+      return if paused?\n+      return unless job ||= reserve\n \n-        unregister_worker(exception)\n+      working_on job\n+      procline \"Processing #{job.queue} since #{Time.now.to_i} [#{job.payload_class_name}]\"\n+\n+      log_with_severity :info, \"got: #{job.inspect}\"\n+      job.worker = self\n+\n+      if fork_per_job?\n+        perform_with_fork(job, &block)\n       end\n+\n+      unless fork_per_job?","path":"lib/resque/worker.rb","position":75,"original_position":75,"commit_id":"ba324a66b4b04a7930fa16fa89244849416f1d75","original_commit_id":"ba324a66b4b04a7930fa16fa89244849416f1d75","user":{"login":"dylanahsmith","id":954402,"avatar_url":"https://avatars.githubusercontent.com/u/954402?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanahsmith","html_url":"https://github.com/dylanahsmith","followers_url":"https://api.github.com/users/dylanahsmith/followers","following_url":"https://api.github.com/users/dylanahsmith/following{/other_user}","gists_url":"https://api.github.com/users/dylanahsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanahsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanahsmith/subscriptions","organizations_url":"https://api.github.com/users/dylanahsmith/orgs","repos_url":"https://api.github.com/users/dylanahsmith/repos","events_url":"https://api.github.com/users/dylanahsmith/events{/privacy}","received_events_url":"https://api.github.com/users/dylanahsmith/received_events","type":"User","site_admin":false},"body":"Now that the fork not implemented logic is moved into perform_with_fork, it isn't obvious in this method that `fork_per_job?` will change.  We should probably have perform_with_fork call `perform` when fork isn't implemented so  we can just use else for the `if fork_per_job?` condition here.","created_at":"2016-07-05T14:16:12Z","updated_at":"2016-07-05T14:16:12Z","html_url":"https://github.com/Shopify/resque/pull/17#discussion_r69570169","pull_request_url":"https://api.github.com/repos/Shopify/resque/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/Shopify/resque/pulls/comments/69570169"},"html":{"href":"https://github.com/Shopify/resque/pull/17#discussion_r69570169"},"pull_request":{"href":"https://api.github.com/repos/Shopify/resque/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/Shopify/resque/pulls/17","id":74801313,"html_url":"https://github.com/Shopify/resque/pull/17","diff_url":"https://github.com/Shopify/resque/pull/17.diff","patch_url":"https://github.com/Shopify/resque/pull/17.patch","issue_url":"https://api.github.com/repos/Shopify/resque/issues/17","number":17,"state":"open","locked":false,"title":"Refactor work loop 2","user":{"login":"fw42","id":2072686,"avatar_url":"https://avatars.githubusercontent.com/u/2072686?v=3","gravatar_id":"","url":"https://api.github.com/users/fw42","html_url":"https://github.com/fw42","followers_url":"https://api.github.com/users/fw42/followers","following_url":"https://api.github.com/users/fw42/following{/other_user}","gists_url":"https://api.github.com/users/fw42/gists{/gist_id}","starred_url":"https://api.github.com/users/fw42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fw42/subscriptions","organizations_url":"https://api.github.com/users/fw42/orgs","repos_url":"https://api.github.com/users/fw42/repos","events_url":"https://api.github.com/users/fw42/events{/privacy}","received_events_url":"https://api.github.com/users/fw42/received_events","type":"User","site_admin":false},"body":"WIP\r\n\r\nsecond try at https://github.com/Shopify/resque/pull/16/\r\ndepends on https://github.com/resque/resque/pull/1470","created_at":"2016-06-22T15:08:17Z","updated_at":"2016-07-05T14:16:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c41d1021b77038b39f4c5ba24d79cecfff223ee","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Shopify/resque/pulls/17/commits","review_comments_url":"https://api.github.com/repos/Shopify/resque/pulls/17/comments","review_comment_url":"https://api.github.com/repos/Shopify/resque/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Shopify/resque/issues/17/comments","statuses_url":"https://api.github.com/repos/Shopify/resque/statuses/ba324a66b4b04a7930fa16fa89244849416f1d75","head":{"label":"Shopify:refactor-work-loop-2","ref":"refactor-work-loop-2","sha":"ba324a66b4b04a7930fa16fa89244849416f1d75","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":19742633,"name":"resque","full_name":"Shopify/resque","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/resque","description":"Resque is a Redis-backed Ruby library for creating background jobs, placing them on multiple queues, and processing them later.","fork":true,"url":"https://api.github.com/repos/Shopify/resque","forks_url":"https://api.github.com/repos/Shopify/resque/forks","keys_url":"https://api.github.com/repos/Shopify/resque/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/resque/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/resque/teams","hooks_url":"https://api.github.com/repos/Shopify/resque/hooks","issue_events_url":"https://api.github.com/repos/Shopify/resque/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/resque/events","assignees_url":"https://api.github.com/repos/Shopify/resque/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/resque/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/resque/tags","blobs_url":"https://api.github.com/repos/Shopify/resque/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/resque/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/resque/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/resque/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/resque/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/resque/languages","stargazers_url":"https://api.github.com/repos/Shopify/resque/stargazers","contributors_url":"https://api.github.com/repos/Shopify/resque/contributors","subscribers_url":"https://api.github.com/repos/Shopify/resque/subscribers","subscription_url":"https://api.github.com/repos/Shopify/resque/subscription","commits_url":"https://api.github.com/repos/Shopify/resque/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/resque/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/resque/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/resque/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/resque/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/resque/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/resque/merges","archive_url":"https://api.github.com/repos/Shopify/resque/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/resque/downloads","issues_url":"https://api.github.com/repos/Shopify/resque/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/resque/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/resque/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/resque/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/resque/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/resque/releases{/id}","deployments_url":"https://api.github.com/repos/Shopify/resque/deployments","created_at":"2014-05-13T14:37:55Z","updated_at":"2016-02-09T01:28:29Z","pushed_at":"2016-07-05T14:08:23Z","git_url":"git://github.com/Shopify/resque.git","ssh_url":"git@github.com:Shopify/resque.git","clone_url":"https://github.com/Shopify/resque.git","svn_url":"https://github.com/Shopify/resque","homepage":"http://github.com/blog/542-introducing-resque","size":1844,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"Shopify:master","ref":"master","sha":"d0e187881e02d852f8e4755aef3c14319636527b","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":19742633,"name":"resque","full_name":"Shopify/resque","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/resque","description":"Resque is a Redis-backed Ruby library for creating background jobs, placing them on multiple queues, and processing them later.","fork":true,"url":"https://api.github.com/repos/Shopify/resque","forks_url":"https://api.github.com/repos/Shopify/resque/forks","keys_url":"https://api.github.com/repos/Shopify/resque/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/resque/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/resque/teams","hooks_url":"https://api.github.com/repos/Shopify/resque/hooks","issue_events_url":"https://api.github.com/repos/Shopify/resque/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/resque/events","assignees_url":"https://api.github.com/repos/Shopify/resque/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/resque/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/resque/tags","blobs_url":"https://api.github.com/repos/Shopify/resque/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/resque/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/resque/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/resque/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/resque/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/resque/languages","stargazers_url":"https://api.github.com/repos/Shopify/resque/stargazers","contributors_url":"https://api.github.com/repos/Shopify/resque/contributors","subscribers_url":"https://api.github.com/repos/Shopify/resque/subscribers","subscription_url":"https://api.github.com/repos/Shopify/resque/subscription","commits_url":"https://api.github.com/repos/Shopify/resque/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/resque/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/resque/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/resque/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/resque/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/resque/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/resque/merges","archive_url":"https://api.github.com/repos/Shopify/resque/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/resque/downloads","issues_url":"https://api.github.com/repos/Shopify/resque/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/resque/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/resque/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/resque/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/resque/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/resque/releases{/id}","deployments_url":"https://api.github.com/repos/Shopify/resque/deployments","created_at":"2014-05-13T14:37:55Z","updated_at":"2016-02-09T01:28:29Z","pushed_at":"2016-07-05T14:08:23Z","git_url":"git://github.com/Shopify/resque.git","ssh_url":"git@github.com:Shopify/resque.git","clone_url":"https://github.com/Shopify/resque.git","svn_url":"https://github.com/Shopify/resque","homepage":"http://github.com/blog/542-introducing-resque","size":1844,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Shopify/resque/pulls/17"},"html":{"href":"https://github.com/Shopify/resque/pull/17"},"issue":{"href":"https://api.github.com/repos/Shopify/resque/issues/17"},"comments":{"href":"https://api.github.com/repos/Shopify/resque/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/Shopify/resque/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/Shopify/resque/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Shopify/resque/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/Shopify/resque/statuses/ba324a66b4b04a7930fa16fa89244849416f1d75"}}}}
{"actor":{"display_login":"dylanahsmith"}}