From f843ee1339033160438217ed5ad421569226e129 Mon Sep 17 00:00:00 2001 From: minie4 Date: Fri, 23 Jun 2023 20:16:48 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Check=20for=20updates=20every=20min?= =?UTF-8?q?ute?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 655e88b..3c59b90 100644 --- a/index.js +++ b/index.js @@ -86,7 +86,7 @@ function formatUpdateMessage(update) { } // Check for timetable updates -setTimeout(async () => { +setInterval(async () => { const history = await timetable.getUpdates(); const lastCheck = await db.getObjectDefault("/lastTimetableUpdate", 0); const updates = history.filter((entry) => entry.updatedAt > lastCheck); @@ -104,7 +104,7 @@ setTimeout(async () => { client.sendHtmlMessage(roomId, plainText(message), message); } } -}, 1000); +}, 1000 * 60); // Handle events client.on("Room.timeline", async function (event, room) {