start timer as daemon

This commit is contained in:
Bastian Schroll 2018-09-21 14:30:20 +02:00
parent 11eab418ed
commit 3cf0b49c0e
2 changed files with 2 additions and 0 deletions

View file

@ -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

View file

@ -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"""