Comparing version 0.3.13 to 0.3.14
@@ -216,3 +216,3 @@ var Q = require('q'), | ||
onError = function(err) { | ||
_this.onJobFinished(job.id, err); | ||
_this.onJobFinished(job.id, true, err); | ||
}; | ||
@@ -232,6 +232,7 @@ | ||
* @param {String} id Job ID. | ||
* @param {Object} err Error, if any. | ||
* @param {Boolean} fail True, if job failed. | ||
* @param {Object} [err] Optional reason of failure. | ||
* @returns {Workers} Chainable API. | ||
*/ | ||
onJobFinished: function(id, err) { | ||
onJobFinished: function(id, fail, err) { | ||
var listeners = this.jobPlanFinishListeners[id] || {}, | ||
@@ -247,5 +248,5 @@ plan, defer; | ||
err? plan.onJobFail(id) : plan.onJobDone(id); | ||
fail? plan.onJobFail(id) : plan.onJobDone(id); | ||
if (err || plan.allDone()) this.terminatePlan(planId, err); | ||
if (fail || plan.allDone()) this.terminatePlan(planId, fail, err); | ||
} | ||
@@ -256,3 +257,3 @@ | ||
terminatePlan: function(planId, err) { | ||
terminatePlan: function(planId, fail, err) { | ||
this.removePlan(planId); | ||
@@ -262,3 +263,3 @@ this.removePlanFinishListener(planId); | ||
var defer = this.getDefer(planId, true); | ||
err? defer.reject(err) : defer.resolve(); | ||
fail? defer.reject(err) : defer.resolve(); | ||
}, | ||
@@ -265,0 +266,0 @@ |
{ | ||
"name": "apw", | ||
"version": "0.3.13", | ||
"version": "0.3.14", | ||
"homepage": "http://github.com/bem/apw", | ||
@@ -5,0 +5,0 @@ "author": "Sergey Kryzhanovsky <skryzhanovsky@ya.ru> (http://github.com/afelix)", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
98913
21
2574