Comparing version 0.4.0 to 0.4.1
@@ -204,7 +204,8 @@ | ||
objJob.on('workData', function(data) {//all data end with \n? | ||
let ds = new Map(JSON.parse(data.toString())); | ||
if(self.app.onData){ | ||
self.app.onData(data,function(){}); | ||
self.app.onData(ds, function(){}); | ||
} | ||
logClient.debug('WORK_DATA >>> ' + data); | ||
logClient.debug('WORK_DATA >>> ' + ds); | ||
}); | ||
@@ -211,0 +212,0 @@ |
@@ -59,3 +59,3 @@ | ||
get origin() { | ||
return `${this.protocol}://${this.host}`; | ||
return `${this.protocol}//${this.host}`; | ||
}, | ||
@@ -198,3 +198,3 @@ | ||
/** | ||
* Return the protocol string "http" or "https" | ||
* Return the protocol string "http:" or "https:" | ||
* | ||
@@ -201,0 +201,0 @@ * @return {String} |
@@ -28,3 +28,3 @@ | ||
if(err) { | ||
//console.error(err.stack); // TODO: may lead to crash `uncaughtException: EIO: i/o error, write` | ||
console.error(err.stack); // done: may lead to crash `uncaughtException: EIO: i/o error, write` #3 solved | ||
ctx.done();// tell scheduler to release a resource | ||
@@ -155,5 +155,5 @@ | ||
if(e instanceof Error){ | ||
//console.error(e.stack); | ||
console.error(e.stack); | ||
}else{ | ||
//console.error(e); | ||
console.error(e); | ||
} | ||
@@ -160,0 +160,0 @@ |
{ | ||
"name": "floodesh", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Floodesh is a distributed web spider/crawler written with Nodejs.", | ||
@@ -5,0 +5,0 @@ "bin": "./bin/floodesh", |
@@ -113,3 +113,4 @@ | ||
done(); | ||
} | ||
}, | ||
performance:{} | ||
}; | ||
@@ -165,3 +166,3 @@ w.emit = sinon.spy(); | ||
beforeEach(()=>{ | ||
ctx = {request:{},response:{}}; | ||
ctx = {request:{},response:{}, performance:{}}; | ||
ctx.opt={uri:"https://www.baidu.com/"}; | ||
@@ -183,3 +184,3 @@ ctx.done=()=>{}; | ||
should.exists(ctx.response.res); | ||
ctx.request.req.should.be.an.instanceof(http.ClientRequest); | ||
ctx.request.req.should.be.an.instanceof(request.Request); | ||
ctx.response.res.should.be.an.instanceof(http.IncomingMessage); | ||
@@ -186,0 +187,0 @@ done(); |
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
51801
1643