Comparing version 0.8.8 to 0.8.9
@@ -117,11 +117,3 @@ | ||
logClient.info("Start fetching job from seed."); | ||
this.emit(JOB_QUEUE,this.seed.map(item=>this._toJob(item)),(e) => { | ||
logClient.silly("Inserted jobs. Here in callback."); | ||
this.dbTasks.pop(); | ||
if(e) | ||
return logClient.error(e); | ||
this._dequeue(this._dehandler); | ||
} ); | ||
this.emit(JOB_QUEUE,this.seed.map(item=>this._toJob(item)),() => this._dequeue(this._dehandler)); | ||
} | ||
@@ -136,3 +128,3 @@ }.bind(this); | ||
if(items.length===0) | ||
return; | ||
return callback(); | ||
@@ -147,8 +139,9 @@ let bulk = this.db.collection(this.name).initializeUnorderedBulkOp(); | ||
logClient.silly("Inserting jobs to mongodb..."); | ||
bulk.execute(callback); | ||
// bulk.execute(err => { | ||
// logClient.silly("Inserted jobs. Here in callback."); | ||
// if(err) logClient.error(err); | ||
// self.dbTasks.pop(); | ||
// }); | ||
//bulk.execute(callback); | ||
bulk.execute(err => { | ||
logClient.silly("Inserted jobs. Here in callback."); | ||
if(err) logClient.error(err); | ||
self.dbTasks.pop(); | ||
callback(); | ||
}); | ||
}); | ||
@@ -187,5 +180,5 @@ } | ||
_enqueue(jobs, callback){ | ||
if(jobs.length === 0) | ||
return; | ||
if(0 === jobs.length) | ||
return callback(); | ||
let items = [], requests=[], self=this; | ||
@@ -206,2 +199,3 @@ for(let i=0;i<jobs.length;i++){ | ||
logClient.error(err); | ||
return callback(); | ||
}else{ | ||
@@ -362,11 +356,3 @@ logClient.verbose(result); | ||
// res must be a job format, cannot handle | ||
self._enqueue(res,e => { | ||
logClient.silly("Inserted jobs. Here in callback."); | ||
self.dbTasks.pop(); | ||
if(e) | ||
logClient.error(e); | ||
self.emit(JOB_END,objJob,Status.success); | ||
}); | ||
self._enqueue(res,() => self.emit(JOB_END,objJob,Status.success)); | ||
}); | ||
@@ -373,0 +359,0 @@ } |
{ | ||
"name": "floodesh", | ||
"version": "0.8.8", | ||
"version": "0.8.9", | ||
"description": "Floodesh is a distributed web spider/crawler written with Nodejs.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
39888
1119