Commit 0afd4c06 authored by Tristan Cavelier's avatar Tristan Cavelier

command.reject acts like an error or a retry according to the status code

parent fe92a4fa
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true, unparam: true */ /*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true, unparam: true */
/*global arrayExtend, setTimeout, indexOf, min */ /*global arrayExtend, setTimeout, indexOf, min, constants */
function enableJobRetry(jio, shared, options) { function enableJobRetry(jio, shared, options) {
...@@ -58,6 +58,13 @@ function enableJobRetry(jio, shared, options) { ...@@ -58,6 +58,13 @@ function enableJobRetry(jio, shared, options) {
defaultMaxRetry(param) defaultMaxRetry(param)
); );
} }
param.command.reject = function (status) {
if (constants.http_action[status || 0] === "retry") {
shared.emit('jobRetry', param, arguments);
} else {
shared.emit('jobFail', param, arguments);
}
};
param.command.retry = function () { param.command.retry = function () {
shared.emit('jobRetry', param, arguments); shared.emit('jobRetry', param, arguments);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment