pass new real estates to the notification service
This commit is contained in:
6
index.js
6
index.js
@@ -1,5 +1,3 @@
|
|||||||
require("dotenv").config();
|
|
||||||
|
|
||||||
const express = require("express");
|
const express = require("express");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const bodyParser = require("body-parser");
|
const bodyParser = require("body-parser");
|
||||||
@@ -13,6 +11,9 @@ const {
|
|||||||
} = require("./app/config/appConfig");
|
} = require("./app/config/appConfig");
|
||||||
const routes = require("./app/routes");
|
const routes = require("./app/routes");
|
||||||
const { crawlAll } = require("./app/crawler/crawl");
|
const { crawlAll } = require("./app/crawler/crawl");
|
||||||
|
const {
|
||||||
|
notifyForNewRealEstates
|
||||||
|
} = require("./app/services/notificationService");
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
@@ -38,6 +39,7 @@ const crawl = () => {
|
|||||||
crawlerRunning = true;
|
crawlerRunning = true;
|
||||||
crawlAll().then(newRealEstates => {
|
crawlAll().then(newRealEstates => {
|
||||||
crawlerRunning = false;
|
crawlerRunning = false;
|
||||||
|
notifyForNewRealEstates(newRealEstates);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user