mirror of
https://github.com/harish2704/node-job-manager.git
synced 2026-09-10 13:11:08 +00:00
Fix:
* rename _start function,
* check whether onError exists before calling
This commit is contained in:
+2
-2
@@ -80,7 +80,7 @@ JobManager.prototype.$doWork_ = function( cb ){
|
|||||||
}
|
}
|
||||||
var worker = self.getFromPool();
|
var worker = self.getFromPool();
|
||||||
this.work( task, worker, function(err){
|
this.work( task, worker, function(err){
|
||||||
if(err){
|
if(err && self.onError ){
|
||||||
self.onError(err, task, worker );
|
self.onError(err, task, worker );
|
||||||
}
|
}
|
||||||
if(self.tasks.length/self.concurrency < self.notifyAt && (!self.isLoadingTakingPlace) ){
|
if(self.tasks.length/self.concurrency < self.notifyAt && (!self.isLoadingTakingPlace) ){
|
||||||
@@ -103,7 +103,7 @@ JobManager.prototype.$trigger = function (){
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
JobManager.prototype._start = function( ) {
|
JobManager.prototype.start = function( ) {
|
||||||
this.state = STATE.RUNNING;
|
this.state = STATE.RUNNING;
|
||||||
this.updateState();
|
this.updateState();
|
||||||
this.$trigger();
|
this.$trigger();
|
||||||
|
|||||||
Reference in New Issue
Block a user