This commit is contained in:
=
2020-09-13 04:48:11 -07:00
parent 8df94da48c
commit a481ecfe37
4 changed files with 51 additions and 20 deletions

View File

@@ -4,6 +4,7 @@ const bodyParser = require("body-parser");
const layout = require("express-layout");
const compression = require("compression");
const forceSSL = require("./app/helpers/forceSSL");
const { logDebug } = require("./app/helpers/log");
const {
APP_PORT,
@@ -38,9 +39,11 @@ app.listen(APP_PORT, () =>
let crawlerRunning = STOP_CRAWLER;
const crawl = () => {
logDebug("Crawl start");
if (!crawlerRunning) {
crawlerRunning = true;
crawlAll().then(newRealEstates => {
logDebug("crawlAll done, new real estate len: ", newRealEstates.length);
crawlerRunning = false;
notifyForNewRealEstates(newRealEstates);
});