diff --git a/src/JobManager.js b/src/JobManager.js index 01b1fd4..f7c7651 100644 --- a/src/JobManager.js +++ b/src/JobManager.js @@ -20,6 +20,7 @@ function JobManager(opts){ this.onLoadMore = null; this.onError = null; this.isLoadingTakingPlace = false; + this.endReached = false; this.runningTasks = 0; } /* @@ -85,7 +86,7 @@ JobManager.prototype.$doWork_ = function( cb ){ self.onError(err, task, worker ); } if(self.tasks.length/self.concurrency < self.notifyAt && (!self.isLoadingTakingPlace) ){ - if( self.onLoadMore ) { + if( self.onLoadMore && !self.endReached ) { self.$onLoadMore(); } }