fix(timers): prevent duplicate timer creation
This commit is contained in:
@@ -10,6 +10,10 @@ class TimerMgr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
create(id, timeout, func) {
|
create(id, timeout, func) {
|
||||||
|
if (this.hasTimer(id)) {
|
||||||
|
log.error(`Timer with id ${id} already exists`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
log.debug("Create timer with id " + id);
|
log.debug("Create timer with id " + id);
|
||||||
this.#timers[id] = actions.ScriptExecution.createTimer(id, timeout, func);
|
this.#timers[id] = actions.ScriptExecution.createTimer(id, timeout, func);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user