mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2025-12-06 07:12:04 +01:00
start timer as daemon
This commit is contained in:
parent
11eab418ed
commit
3cf0b49c0e
|
|
@ -48,6 +48,7 @@ class RepeatedTimer:
|
||||||
self._event.clear()
|
self._event.clear()
|
||||||
self._thread = Thread(target=self._target)
|
self._thread = Thread(target=self._target)
|
||||||
self._thread.name = "RepTim(" + str(self._interval) + ")"
|
self._thread.name = "RepTim(" + str(self._interval) + ")"
|
||||||
|
self._thread.daemon = True # start as daemon (thread dies if main program ends)
|
||||||
self._thread.start()
|
self._thread.start()
|
||||||
logging.debug("start repeatedTimer: %s", self._thread.name)
|
logging.debug("start repeatedTimer: %s", self._thread.name)
|
||||||
return True
|
return True
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ from boswatch.utils.timer import RepeatedTimer
|
||||||
|
|
||||||
# todo add more tests to overlap all testcases
|
# todo add more tests to overlap all testcases
|
||||||
|
|
||||||
|
|
||||||
class Test_Timer:
|
class Test_Timer:
|
||||||
"""!Unittest for the timer class"""
|
"""!Unittest for the timer class"""
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue