fix(TimerMgr): cancel existing timer before creating a new one
This commit is contained in:
@@ -11,8 +11,7 @@ class TimerMgr {
|
||||
|
||||
create(id, timeout, func, ...params) {
|
||||
if (this.hasTimer(id)) {
|
||||
log.error(`Timer with id ${id} already exists`);
|
||||
return;
|
||||
this.cancel(id);
|
||||
}
|
||||
log.debug("Create timer with id " + id);
|
||||
this.#timers[id] = actions.ScriptExecution.createTimer(id, timeout, func, ...params);
|
||||
|
||||
Reference in New Issue
Block a user