From e8115a921522490ba1b3fffa41c5e0f4f1da8383 Mon Sep 17 00:00:00 2001 From: = Date: Thu, 10 Sep 2020 14:26:48 -0700 Subject: [PATCH] moar fixes --- app/crawler/specificCrawlers/olx.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/crawler/specificCrawlers/olx.js b/app/crawler/specificCrawlers/olx.js index 44ce679..e2a0492 100644 --- a/app/crawler/specificCrawlers/olx.js +++ b/app/crawler/specificCrawlers/olx.js @@ -228,16 +228,18 @@ class OlxCrawler { } + const hamo = [] const { scrapedData, errors } = await PromisePool .withConcurrency(2) .for(asyncScraping) .process(async data => { const result = await this.scrapeAd(data) await this.sleep(this.delayBetweenPages); - return result; + hamo.push(result) + return result; //TODO: this does not work, scrapedData is null, hamo works }) - const filteredScrapedData = scrapedData.filter(adData => !!adData); + const filteredScrapedData = hamo.filter(adData => !!adData); return filteredScrapedData; } catch (e) { console.error("Exception caught:" + e);