Skip to content

Commit

Permalink
Should fix timer errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Psychokiller1888 committed Sep 6, 2023
1 parent 0c47c61 commit 5deb369
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions core/util/ThreadManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ def doLater(self, interval: float, func: Callable, args: list = None, kwargs: di


def onTimerEnd(self, timer: ThreadTimer):
if not timer or not timer.callback:
return

timer.callback(*timer.args, **timer.kwargs)
self.removeTimer(timer)

try:
timer.callback(*timer.args, **timer.kwargs)
self.removeTimer(timer)
except:
# timer has no callback
pass

def removeTimer(self, timer: ThreadTimer):
if not timer or not timer.callback:
if not timer:
return

if timer.timer.is_alive():
Expand Down

0 comments on commit 5deb369

Please sign in to comment.