From 9c2f9c4c1865a3f4972219f3bd4cf9578babf919 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Wed, 3 Feb 2021 10:40:38 +0100 Subject: [PATCH 1/2] Fix timer error --- boswatch/timer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boswatch/timer.py b/boswatch/timer.py index fe600ea..11bb03f 100644 --- a/boswatch/timer.py +++ b/boswatch/timer.py @@ -61,9 +61,9 @@ 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._event.set() self._thread.join() return True logging.warning("repeatedTimer always stopped") From 3a627c94a1f5c210f175a00fca2d6a3b4b6c1a52 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Wed, 3 Feb 2021 10:43:12 +0100 Subject: [PATCH 2/2] Update timer.py --- boswatch/timer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boswatch/timer.py b/boswatch/timer.py index 11bb03f..5c4e8dd 100644 --- a/boswatch/timer.py +++ b/boswatch/timer.py @@ -64,7 +64,8 @@ class RepeatedTimer: if self._thread is not None: logging.debug("stop repeatedTimer: %s", self._thread.name) self._event.set() - self._thread.join() + if self._thread is not None: + self._thread.join() return True logging.warning("repeatedTimer always stopped") return True