add debugging log switch for crawler process

This commit is contained in:
Bilal Catic
2019-10-25 11:08:52 +02:00
parent 7e3b0bfcd5
commit 747ebb88e5
5 changed files with 25 additions and 5 deletions

View File

@@ -13,7 +13,10 @@ const {
CRAWLER_AD_TYPE
} = require("../../common/enums");
const { DEFAULT_TIMEZONE } = require("../../config/appConfig");
const {
DEFAULT_TIMEZONE,
PRINT_CRAWLER_DEBUG
} = require("../../config/appConfig");
const OLX_ENUMS = {
OLX_AD_TYPE: {
@@ -156,6 +159,10 @@ class OlxCrawler {
}
async indexSinglePage(url, maxResultsPerPage) {
if (PRINT_CRAWLER_DEBUG) {
console.log("[OLX] Index page : ", url);
}
try {
const res = await fetch(url);
const body = await res.text();