{"action":"created","comment":{"url":"https://api.github.com/repos/taskrabbit/node-resque/pulls/comments/46760140","id":46760140,"diff_hunk":"@@ -17,30 +21,70 @@ var simpleRetry = function(worker, func, queue, job, args, options){\n     self.queueObject = self.worker;\n   }\n \n-  self.sleep = 1000;\n-  if(self.options.sleep){ self.sleep = self.options.sleep; }\n+  if (self.args) {\n+    jobHash = crypto.createHash('sha256').update(JSON.stringify(self.args)).digest('hex');\n+    self.retryKey = self.queueObject.connection.key('retryTimes', jobHash);\n+  }\n };\n \n ////////////////////\n // PLUGIN METHODS //\n ////////////////////\n \n+simpleRetry.prototype.updateRetryTimes = function(callback) {\n+  var self = this;\n+\n+  self.queueObject.connection.redis.incr(self.retryKey, (function(err, result) {\n+    if (err) { return callback(err); }\n+\n+    self.queueObject.connection.redis.expire(self.retryKey, self.options.retryInterval[self.options.retryInterval.length - 1] * 2, function(err) {\n+      if (err) {\n+        callback(err);\n+      } else if (result > self.options.retryInterval.length) {\n+        callback(new Error('Retry limit exceeded'));","path":"lib/plugins/simpleRetry.js","position":43,"original_position":43,"commit_id":"0acfec03368ee588e58a4479271b836436a235fd","original_commit_id":"0acfec03368ee588e58a4479271b836436a235fd","user":{"login":"faceair","id":3659110,"avatar_url":"https://avatars.githubusercontent.com/u/3659110?v=3","gravatar_id":"","url":"https://api.github.com/users/faceair","html_url":"https://github.com/faceair","followers_url":"https://api.github.com/users/faceair/followers","following_url":"https://api.github.com/users/faceair/following{/other_user}","gists_url":"https://api.github.com/users/faceair/gists{/gist_id}","starred_url":"https://api.github.com/users/faceair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faceair/subscriptions","organizations_url":"https://api.github.com/users/faceair/orgs","repos_url":"https://api.github.com/users/faceair/repos","events_url":"https://api.github.com/users/faceair/events{/privacy}","received_events_url":"https://api.github.com/users/faceair/received_events","type":"User","site_admin":false},"body":"Should we overwrite `this.worker.error` with the original error ? And it's found that many errors have been ignored in other place.","created_at":"2015-12-05T16:37:03Z","updated_at":"2015-12-05T16:37:03Z","html_url":"https://github.com/taskrabbit/node-resque/pull/107#discussion_r46760140","pull_request_url":"https://api.github.com/repos/taskrabbit/node-resque/pulls/107","_links":{"self":{"href":"https://api.github.com/repos/taskrabbit/node-resque/pulls/comments/46760140"},"html":{"href":"https://github.com/taskrabbit/node-resque/pull/107#discussion_r46760140"},"pull_request":{"href":"https://api.github.com/repos/taskrabbit/node-resque/pulls/107"}}},"pull_request":{"url":"https://api.github.com/repos/taskrabbit/node-resque/pulls/107","id":52559889,"html_url":"https://github.com/taskrabbit/node-resque/pull/107","diff_url":"https://github.com/taskrabbit/node-resque/pull/107.diff","patch_url":"https://github.com/taskrabbit/node-resque/pull/107.patch","issue_url":"https://api.github.com/repos/taskrabbit/node-resque/issues/107","number":107,"state":"open","locked":false,"title":"improve default plugins","user":{"login":"faceair","id":3659110,"avatar_url":"https://avatars.githubusercontent.com/u/3659110?v=3","gravatar_id":"","url":"https://api.github.com/users/faceair","html_url":"https://github.com/faceair","followers_url":"https://api.github.com/users/faceair/followers","following_url":"https://api.github.com/users/faceair/following{/other_user}","gists_url":"https://api.github.com/users/faceair/gists{/gist_id}","starred_url":"https://api.github.com/users/faceair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faceair/subscriptions","organizations_url":"https://api.github.com/users/faceair/orgs","repos_url":"https://api.github.com/users/faceair/repos","events_url":"https://api.github.com/users/faceair/events{/privacy}","received_events_url":"https://api.github.com/users/faceair/received_events","type":"User","site_admin":false},"body":"1. use json-stable-stringify replace JSON.stringify, as before same args maybe not available.\r\n\r\n2. add retry option, now we can define the specific retry time and times.","created_at":"2015-12-03T16:46:10Z","updated_at":"2015-12-05T16:37:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"09990ee058b9f70864d80920d6743348ca333966","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/taskrabbit/node-resque/pulls/107/commits","review_comments_url":"https://api.github.com/repos/taskrabbit/node-resque/pulls/107/comments","review_comment_url":"https://api.github.com/repos/taskrabbit/node-resque/pulls/comments{/number}","comments_url":"https://api.github.com/repos/taskrabbit/node-resque/issues/107/comments","statuses_url":"https://api.github.com/repos/taskrabbit/node-resque/statuses/0acfec03368ee588e58a4479271b836436a235fd","head":{"label":"faceair:master","ref":"master","sha":"0acfec03368ee588e58a4479271b836436a235fd","user":{"login":"faceair","id":3659110,"avatar_url":"https://avatars.githubusercontent.com/u/3659110?v=3","gravatar_id":"","url":"https://api.github.com/users/faceair","html_url":"https://github.com/faceair","followers_url":"https://api.github.com/users/faceair/followers","following_url":"https://api.github.com/users/faceair/following{/other_user}","gists_url":"https://api.github.com/users/faceair/gists{/gist_id}","starred_url":"https://api.github.com/users/faceair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faceair/subscriptions","organizations_url":"https://api.github.com/users/faceair/orgs","repos_url":"https://api.github.com/users/faceair/repos","events_url":"https://api.github.com/users/faceair/events{/privacy}","received_events_url":"https://api.github.com/users/faceair/received_events","type":"User","site_admin":false},"repo":{"id":45794631,"name":"node-resque","full_name":"faceair/node-resque","owner":{"login":"faceair","id":3659110,"avatar_url":"https://avatars.githubusercontent.com/u/3659110?v=3","gravatar_id":"","url":"https://api.github.com/users/faceair","html_url":"https://github.com/faceair","followers_url":"https://api.github.com/users/faceair/followers","following_url":"https://api.github.com/users/faceair/following{/other_user}","gists_url":"https://api.github.com/users/faceair/gists{/gist_id}","starred_url":"https://api.github.com/users/faceair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faceair/subscriptions","organizations_url":"https://api.github.com/users/faceair/orgs","repos_url":"https://api.github.com/users/faceair/repos","events_url":"https://api.github.com/users/faceair/events{/privacy}","received_events_url":"https://api.github.com/users/faceair/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/faceair/node-resque","description":"It's Resque... In node!","fork":true,"url":"https://api.github.com/repos/faceair/node-resque","forks_url":"https://api.github.com/repos/faceair/node-resque/forks","keys_url":"https://api.github.com/repos/faceair/node-resque/keys{/key_id}","collaborators_url":"https://api.github.com/repos/faceair/node-resque/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/faceair/node-resque/teams","hooks_url":"https://api.github.com/repos/faceair/node-resque/hooks","issue_events_url":"https://api.github.com/repos/faceair/node-resque/issues/events{/number}","events_url":"https://api.github.com/repos/faceair/node-resque/events","assignees_url":"https://api.github.com/repos/faceair/node-resque/assignees{/user}","branches_url":"https://api.github.com/repos/faceair/node-resque/branches{/branch}","tags_url":"https://api.github.com/repos/faceair/node-resque/tags","blobs_url":"https://api.github.com/repos/faceair/node-resque/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/faceair/node-resque/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/faceair/node-resque/git/refs{/sha}","trees_url":"https://api.github.com/repos/faceair/node-resque/git/trees{/sha}","statuses_url":"https://api.github.com/repos/faceair/node-resque/statuses/{sha}","languages_url":"https://api.github.com/repos/faceair/node-resque/languages","stargazers_url":"https://api.github.com/repos/faceair/node-resque/stargazers","contributors_url":"https://api.github.com/repos/faceair/node-resque/contributors","subscribers_url":"https://api.github.com/repos/faceair/node-resque/subscribers","subscription_url":"https://api.github.com/repos/faceair/node-resque/subscription","commits_url":"https://api.github.com/repos/faceair/node-resque/commits{/sha}","git_commits_url":"https://api.github.com/repos/faceair/node-resque/git/commits{/sha}","comments_url":"https://api.github.com/repos/faceair/node-resque/comments{/number}","issue_comment_url":"https://api.github.com/repos/faceair/node-resque/issues/comments{/number}","contents_url":"https://api.github.com/repos/faceair/node-resque/contents/{+path}","compare_url":"https://api.github.com/repos/faceair/node-resque/compare/{base}...{head}","merges_url":"https://api.github.com/repos/faceair/node-resque/merges","archive_url":"https://api.github.com/repos/faceair/node-resque/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/faceair/node-resque/downloads","issues_url":"https://api.github.com/repos/faceair/node-resque/issues{/number}","pulls_url":"https://api.github.com/repos/faceair/node-resque/pulls{/number}","milestones_url":"https://api.github.com/repos/faceair/node-resque/milestones{/number}","notifications_url":"https://api.github.com/repos/faceair/node-resque/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/faceair/node-resque/labels{/name}","releases_url":"https://api.github.com/repos/faceair/node-resque/releases{/id}","created_at":"2015-11-08T19:10:01Z","updated_at":"2015-11-08T19:10:02Z","pushed_at":"2015-12-04T09:34:33Z","git_url":"git://github.com/faceair/node-resque.git","ssh_url":"git@github.com:faceair/node-resque.git","clone_url":"https://github.com/faceair/node-resque.git","svn_url":"https://github.com/faceair/node-resque","homepage":"","size":632,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"taskrabbit:master","ref":"master","sha":"9b832cd0b994f795d095670a81d396517cd0ad7e","user":{"login":"taskrabbit","id":666590,"avatar_url":"https://avatars.githubusercontent.com/u/666590?v=3","gravatar_id":"","url":"https://api.github.com/users/taskrabbit","html_url":"https://github.com/taskrabbit","followers_url":"https://api.github.com/users/taskrabbit/followers","following_url":"https://api.github.com/users/taskrabbit/following{/other_user}","gists_url":"https://api.github.com/users/taskrabbit/gists{/gist_id}","starred_url":"https://api.github.com/users/taskrabbit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskrabbit/subscriptions","organizations_url":"https://api.github.com/users/taskrabbit/orgs","repos_url":"https://api.github.com/users/taskrabbit/repos","events_url":"https://api.github.com/users/taskrabbit/events{/privacy}","received_events_url":"https://api.github.com/users/taskrabbit/received_events","type":"Organization","site_admin":false},"repo":{"id":13003323,"name":"node-resque","full_name":"taskrabbit/node-resque","owner":{"login":"taskrabbit","id":666590,"avatar_url":"https://avatars.githubusercontent.com/u/666590?v=3","gravatar_id":"","url":"https://api.github.com/users/taskrabbit","html_url":"https://github.com/taskrabbit","followers_url":"https://api.github.com/users/taskrabbit/followers","following_url":"https://api.github.com/users/taskrabbit/following{/other_user}","gists_url":"https://api.github.com/users/taskrabbit/gists{/gist_id}","starred_url":"https://api.github.com/users/taskrabbit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskrabbit/subscriptions","organizations_url":"https://api.github.com/users/taskrabbit/orgs","repos_url":"https://api.github.com/users/taskrabbit/repos","events_url":"https://api.github.com/users/taskrabbit/events{/privacy}","received_events_url":"https://api.github.com/users/taskrabbit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/taskrabbit/node-resque","description":"It's Resque... In node!","fork":false,"url":"https://api.github.com/repos/taskrabbit/node-resque","forks_url":"https://api.github.com/repos/taskrabbit/node-resque/forks","keys_url":"https://api.github.com/repos/taskrabbit/node-resque/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taskrabbit/node-resque/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taskrabbit/node-resque/teams","hooks_url":"https://api.github.com/repos/taskrabbit/node-resque/hooks","issue_events_url":"https://api.github.com/repos/taskrabbit/node-resque/issues/events{/number}","events_url":"https://api.github.com/repos/taskrabbit/node-resque/events","assignees_url":"https://api.github.com/repos/taskrabbit/node-resque/assignees{/user}","branches_url":"https://api.github.com/repos/taskrabbit/node-resque/branches{/branch}","tags_url":"https://api.github.com/repos/taskrabbit/node-resque/tags","blobs_url":"https://api.github.com/repos/taskrabbit/node-resque/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taskrabbit/node-resque/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taskrabbit/node-resque/git/refs{/sha}","trees_url":"https://api.github.com/repos/taskrabbit/node-resque/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taskrabbit/node-resque/statuses/{sha}","languages_url":"https://api.github.com/repos/taskrabbit/node-resque/languages","stargazers_url":"https://api.github.com/repos/taskrabbit/node-resque/stargazers","contributors_url":"https://api.github.com/repos/taskrabbit/node-resque/contributors","subscribers_url":"https://api.github.com/repos/taskrabbit/node-resque/subscribers","subscription_url":"https://api.github.com/repos/taskrabbit/node-resque/subscription","commits_url":"https://api.github.com/repos/taskrabbit/node-resque/commits{/sha}","git_commits_url":"https://api.github.com/repos/taskrabbit/node-resque/git/commits{/sha}","comments_url":"https://api.github.com/repos/taskrabbit/node-resque/comments{/number}","issue_comment_url":"https://api.github.com/repos/taskrabbit/node-resque/issues/comments{/number}","contents_url":"https://api.github.com/repos/taskrabbit/node-resque/contents/{+path}","compare_url":"https://api.github.com/repos/taskrabbit/node-resque/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taskrabbit/node-resque/merges","archive_url":"https://api.github.com/repos/taskrabbit/node-resque/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taskrabbit/node-resque/downloads","issues_url":"https://api.github.com/repos/taskrabbit/node-resque/issues{/number}","pulls_url":"https://api.github.com/repos/taskrabbit/node-resque/pulls{/number}","milestones_url":"https://api.github.com/repos/taskrabbit/node-resque/milestones{/number}","notifications_url":"https://api.github.com/repos/taskrabbit/node-resque/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taskrabbit/node-resque/labels{/name}","releases_url":"https://api.github.com/repos/taskrabbit/node-resque/releases{/id}","created_at":"2013-09-21T22:20:04Z","updated_at":"2015-12-05T13:06:57Z","pushed_at":"2015-12-04T23:30:20Z","git_url":"git://github.com/taskrabbit/node-resque.git","ssh_url":"git@github.com:taskrabbit/node-resque.git","clone_url":"https://github.com/taskrabbit/node-resque.git","svn_url":"https://github.com/taskrabbit/node-resque","homepage":"","size":640,"stargazers_count":206,"watchers_count":206,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":5,"forks":41,"open_issues":5,"watchers":206,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/taskrabbit/node-resque/pulls/107"},"html":{"href":"https://github.com/taskrabbit/node-resque/pull/107"},"issue":{"href":"https://api.github.com/repos/taskrabbit/node-resque/issues/107"},"comments":{"href":"https://api.github.com/repos/taskrabbit/node-resque/issues/107/comments"},"review_comments":{"href":"https://api.github.com/repos/taskrabbit/node-resque/pulls/107/comments"},"review_comment":{"href":"https://api.github.com/repos/taskrabbit/node-resque/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/taskrabbit/node-resque/pulls/107/commits"},"statuses":{"href":"https://api.github.com/repos/taskrabbit/node-resque/statuses/0acfec03368ee588e58a4479271b836436a235fd"}}}}