remove all logging noise

This commit is contained in:
Bilal Catic
2019-09-06 12:01:25 +02:00
parent 1d29f6c8ac
commit b0f9c2c47b
6 changed files with 753 additions and 752 deletions

View File

@@ -4,8 +4,6 @@ const db = require("../models/index");
const { allMarketAlerts } = require("../helpers/db/dbHelper");
async function crawlAll() {
console.log("CRAWLER SERVICE: crawlAll");
try {
const marketAlertsFromDb = await allMarketAlerts(true);
const hrefs = [];
@@ -18,8 +16,6 @@ async function crawlAll() {
hrefs[marketAlert.request].push(marketAlert.url);
});
console.log("CRAWLER SERVICE: GLOBAL HREFS");
console.log(hrefs);
const olxCrawler = new OlxCrawler(hrefs);
const crawlers = [olxCrawler];
@@ -30,11 +26,6 @@ async function crawlAll() {
try {
const marketAlertsFromDb = await allMarketAlerts(false, true);
console.log(
"CRAWLER SERVICE: number of existing MarketAlerts from db: " +
marketAlertsFromDb.length
);
const marketAlerts = [];
const mergedResults = [].concat.apply([], results);
@@ -56,9 +47,6 @@ async function crawlAll() {
hasLocation: result.hasLocation
});
}
console.log(
"CRAWLER SERVICE: Number of crawler results: " + marketAlerts.length
);
try {
const filteredMarketAlerts = marketAlerts.filter(
@@ -67,10 +55,6 @@ async function crawlAll() {
return elem.url === url && elem.request === request;
})
);
console.log(
"CRAWLER SERVICE: Number of new crawler results: " +
filteredMarketAlerts.length
);
await db.MarketAlert.bulkCreate(filteredMarketAlerts);
} catch (e) {