Added a function to stop the healthchecks timer

This commit is contained in:
Mathias Wagner
2022-08-28 22:55:32 +02:00
parent 8572970882
commit ae2d9bef08
+8
View File
@@ -51,4 +51,12 @@ module.exports.sendRunning = async () => {
// Starts a timer which sends a ping every minute
module.exports.startTimer = () => {
job = schedule.scheduleJob('* * * * *', () => this.sendCurrent());
}
// Stops the timer
module.exports.stopTimer = () => {
if (job !== undefined) {
job.cancel();
job = undefined;
}
}