From 763d95199642960cce4ea548bc880cff3f97e064 Mon Sep 17 00:00:00 2001 From: William Bartholomew Date: Thu, 3 Nov 2016 09:41:47 -0700 Subject: [PATCH] Remove comments and improve logging --- lib/crawler.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/crawler.js b/lib/crawler.js index 5a3b225..1bfcb77 100644 --- a/lib/crawler.js +++ b/lib/crawler.js @@ -13,18 +13,18 @@ class Crawler { start() { return this.queue.pop() - .catch() .then(this._convertToRequest.bind(this)) - .then((request) => { - console.log(request.crawl.url); + .then(this._filterSeen.bind(this)) + .then(request => { + if (request) { + this.logger.log('info', `${request.crawl.url} [${request.crawl.type}]`); + } return request; }) - .then(this._filterSeen.bind(this)) .then(this._fetch.bind(this)) .then(this._convertToDocument.bind(this)) .then(this._processDocument.bind(this)) .then(this._storeDocument.bind(this)) - .catch() .then(this._deleteFromQueue.bind(this)) .then(this._markSeen.bind(this)) .then(this._startNext.bind(this));