From 7852cda9e6ce56d0301dfdcdf38db44db08558a0 Mon Sep 17 00:00:00 2001 From: Christian Weimann Date: Fri, 10 Jan 2025 06:00:17 +0100 Subject: [PATCH] fix(timers): prevent duplicate timer creation --- utils/TimerMgr.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/TimerMgr.js b/utils/TimerMgr.js index 19ffd10..ee4f796 100644 --- a/utils/TimerMgr.js +++ b/utils/TimerMgr.js @@ -10,6 +10,10 @@ class TimerMgr { } create(id, timeout, func) { + if (this.hasTimer(id)) { + log.error(`Timer with id ${id} already exists`); + return; + } log.debug("Create timer with id " + id); this.#timers[id] = actions.ScriptExecution.createTimer(id, timeout, func); }