🔧 Make update interval configurable

This commit is contained in:
2023-06-24 15:15:33 +02:00
parent 68861e55db
commit cc944871a4
2 changed files with 4 additions and 1 deletions

View File

@ -5,6 +5,9 @@
# (Make sure the /api and https:// is included in the endpoint) # (Make sure the /api and https:// is included in the endpoint)
TIMETABLE_ENDPOINT= TIMETABLE_ENDPOINT=
TIMETABLE_TOKEN= TIMETABLE_TOKEN=
# How often should the script query for timetable updates
# Default: 60000 (every minute)
TIMETABLE_INTERVAL=
# Set the Matrix url, bot user name and auth token here # Set the Matrix url, bot user name and auth token here
MATRIX_URL= MATRIX_URL=

View File

@ -126,7 +126,7 @@ setInterval(async () => {
client.sendHtmlMessage(roomId, plainText(message), message); client.sendHtmlMessage(roomId, plainText(message), message);
} }
} }
}, 1000); }, process.env.TIMETABLE_INTERVAL || 1000 * 60);
// Handle events // Handle events
client.on("Room.timeline", async function (event, room) { client.on("Room.timeline", async function (event, room) {