feat: implement reminder functionality and enhance notification service with logging
This commit is contained in:
7
app.js
7
app.js
@@ -9,7 +9,7 @@ const compression = require("compression");
|
||||
const unknownEndpoint = require("./middleware/unKnownEndpoint");
|
||||
const { handleError } = require("./helpers/error");
|
||||
const { checkConnection, mqttClient } = require("./config");
|
||||
const { onNotification } = require("./services/notifikasi-wa.service");
|
||||
const notifikasiWaService = require("./services/notifikasi-wa.service");
|
||||
|
||||
const app = express();
|
||||
|
||||
@@ -51,7 +51,10 @@ app.use(handleError);
|
||||
// Saat pesan diterima
|
||||
mqttClient.on('message', (topic, message) => {
|
||||
console.log(`Received message on topic "${topic}":`, message.toString());
|
||||
onNotification(topic, message);
|
||||
notifikasiWaService.onNotification(topic, message);
|
||||
notifikasiWaService.onNotificationReminder(topic, message);
|
||||
});
|
||||
|
||||
notifikasiWaService.runReminder();
|
||||
|
||||
module.exports = app;
|
||||
|
||||
Reference in New Issue
Block a user