diff --git a/boswatch/utils/timer.py b/boswatch/utils/timer.py index 0416035..be69ec4 100644 --- a/boswatch/utils/timer.py +++ b/boswatch/utils/timer.py @@ -48,6 +48,7 @@ class RepeatedTimer: self._event.clear() self._thread = Thread(target=self._target) self._thread.name = "RepTim(" + str(self._interval) + ")" + self._thread.daemon = True # start as daemon (thread dies if main program ends) self._thread.start() logging.debug("start repeatedTimer: %s", self._thread.name) return True diff --git a/test/test_timer.py b/test/test_timer.py index 4c8b3c6..e567ac5 100644 --- a/test/test_timer.py +++ b/test/test_timer.py @@ -22,6 +22,7 @@ from boswatch.utils.timer import RepeatedTimer # todo add more tests to overlap all testcases + class Test_Timer: """!Unittest for the timer class"""