diff --git a/opt/ahenk/base/timer/setup_timer.py b/opt/ahenk/base/timer/setup_timer.py index c70a1f2..2d16c07 100644 --- a/opt/ahenk/base/timer/setup_timer.py +++ b/opt/ahenk/base/timer/setup_timer.py @@ -4,5 +4,5 @@ from multiprocessing import Process class SetupTimer: @staticmethod def start(timer): - thread_timer = Process(target=timer.run) - thread_timer.start() + timer.setDaemon(True) + timer.start() diff --git a/opt/ahenk/base/timer/timer.py b/opt/ahenk/base/timer/timer.py index 43a7ede..e715bc7 100644 --- a/opt/ahenk/base/timer/timer.py +++ b/opt/ahenk/base/timer/timer.py @@ -1,8 +1,9 @@ import time +import threading - -class Timer: +class Timer(threading.Thread): def __init__(self, timeout, timeout_function, checker_func=None, checker_success_function=None, **kwargs): + threading.Thread.__init__(self) self.timeout = int(timeout) self.timeout_function = timeout_function self.timeout_function_args = None