Merge pull request #71 from BOSWatch/fix_timer_error

Fix timer error
This commit is contained in:
Bastian Schroll 2021-02-04 20:37:25 +01:00 committed by GitHub
commit a74f28150d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,10 +61,11 @@ class RepeatedTimer:
"""!Stop the timer worker thread
@return True or False"""
self._event.set()
if self._thread is not None:
logging.debug("stop repeatedTimer: %s", self._thread.name)
self._thread.join()
self._event.set()
if self._thread is not None:
self._thread.join()
return True
logging.warning("repeatedTimer always stopped")
return True