{"action":"created","issue":{"url":"https://api.github.com/repos/caolan/async/issues/1001","repository_url":"https://api.github.com/repos/caolan/async","labels_url":"https://api.github.com/repos/caolan/async/issues/1001/labels{/name}","comments_url":"https://api.github.com/repos/caolan/async/issues/1001/comments","events_url":"https://api.github.com/repos/caolan/async/issues/1001/events","html_url":"https://github.com/caolan/async/issues/1001","id":125162387,"number":1001,"title":"Ability to change retry() params from the task?","user":{"login":"eexit","id":57098,"avatar_url":"https://avatars.githubusercontent.com/u/57098?v=3","gravatar_id":"","url":"https://api.github.com/users/eexit","html_url":"https://github.com/eexit","followers_url":"https://api.github.com/users/eexit/followers","following_url":"https://api.github.com/users/eexit/following{/other_user}","gists_url":"https://api.github.com/users/eexit/gists{/gist_id}","starred_url":"https://api.github.com/users/eexit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eexit/subscriptions","organizations_url":"https://api.github.com/users/eexit/orgs","repos_url":"https://api.github.com/users/eexit/repos","events_url":"https://api.github.com/users/eexit/events{/privacy}","received_events_url":"https://api.github.com/users/eexit/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/caolan/async/labels/feature","name":"feature","color":"bfd4f2"},{"url":"https://api.github.com/repos/caolan/async/labels/feedback-wanted","name":"feedback-wanted","color":"fbca04"},{"url":"https://api.github.com/repos/caolan/async/labels/question","name":"question","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-01-06T11:46:41Z","updated_at":"2016-06-09T21:25:32Z","closed_at":"2016-06-09T21:25:31Z","body":"Hello,\r\n\r\nI would like to know if it'd be possible to be able to update the `times` argument of the `retry()` from the `task`?\r\nFor instance, I would like to be able to increase the `interval` value as the attempt count increases or trim down the attempt count to `0` when a particular error occurred (in order to avoid unnecessary doomed attempts).\r\n\r\nExample:\r\n\r\n```javascript\r\nvar opts = {\r\n    times: 3,\r\n    interval: 500\r\n};\r\n\r\nasync.retry(opts, function (callback) {\r\n    someCall(function(err) {\r\n        if (err) {\r\n            switch (err.code) {\r\n                case 'Code1':\r\n                    opts.interval += 500; // Increases the interval for next attempt\r\n                    return callback(err);\r\n                case 'Code2':\r\n                    opts.times = 0; // Avoid other attempts\r\n                    return callback(err);\r\n                default:\r\n                    return callback(err);\r\n            }\r\n        }\r\n\r\n        callback();\r\n    });\r\n}, function (err) {\r\n    // Some code\r\n});\r\n```\r\n\r\nAny idea or workaround?\r\n\r\nThanks,"},"comment":{"url":"https://api.github.com/repos/caolan/async/issues/comments/225031652","html_url":"https://github.com/caolan/async/issues/1001#issuecomment-225031652","issue_url":"https://api.github.com/repos/caolan/async/issues/1001","id":225031652,"user":{"login":"aearly","id":558190,"avatar_url":"https://avatars.githubusercontent.com/u/558190?v=3","gravatar_id":"","url":"https://api.github.com/users/aearly","html_url":"https://github.com/aearly","followers_url":"https://api.github.com/users/aearly/followers","following_url":"https://api.github.com/users/aearly/following{/other_user}","gists_url":"https://api.github.com/users/aearly/gists{/gist_id}","starred_url":"https://api.github.com/users/aearly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aearly/subscriptions","organizations_url":"https://api.github.com/users/aearly/orgs","repos_url":"https://api.github.com/users/aearly/repos","events_url":"https://api.github.com/users/aearly/events{/privacy}","received_events_url":"https://api.github.com/users/aearly/received_events","type":"User","site_admin":false},"created_at":"2016-06-09T21:25:31Z","updated_at":"2016-06-09T21:25:31Z","body":"I think the behavior added in #1161 should be good enough for now."}}
{"actor":{"display_login":"aearly"}}