mirror of
https://github.com/harish2704/node-job-manager.git
synced 2026-09-10 13:11:08 +00:00
Added 'endreached' support.
if this is set to true, onLoadmore is not called further
This commit is contained in:
+2
-1
@@ -20,6 +20,7 @@ function JobManager(opts){
|
|||||||
this.onLoadMore = null;
|
this.onLoadMore = null;
|
||||||
this.onError = null;
|
this.onError = null;
|
||||||
this.isLoadingTakingPlace = false;
|
this.isLoadingTakingPlace = false;
|
||||||
|
this.endReached = false;
|
||||||
this.runningTasks = 0;
|
this.runningTasks = 0;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -85,7 +86,7 @@ JobManager.prototype.$doWork_ = function( cb ){
|
|||||||
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) ){
|
||||||
if( self.onLoadMore ) {
|
if( self.onLoadMore && !self.endReached ) {
|
||||||
self.$onLoadMore();
|
self.$onLoadMore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user