pass new real estates to the notification service

This commit is contained in:
Bilal Catic
2019-09-30 13:53:35 +02:00
parent 99a6cefd89
commit 37ba7e2c8c

View File

@@ -1,5 +1,3 @@
require("dotenv").config();
const express = require("express");
const path = require("path");
const bodyParser = require("body-parser");
@@ -13,6 +11,9 @@ const {
} = require("./app/config/appConfig");
const routes = require("./app/routes");
const { crawlAll } = require("./app/crawler/crawl");
const {
notifyForNewRealEstates
} = require("./app/services/notificationService");
const app = express();
@@ -38,6 +39,7 @@ const crawl = () => {
crawlerRunning = true;
crawlAll().then(newRealEstates => {
crawlerRunning = false;
notifyForNewRealEstates(newRealEstates);
});
}
};