Skip to content

Commit

Permalink
Make sure the datalogger timer stops.
Browse files Browse the repository at this point in the history
  • Loading branch information
BenediktBurger committed Aug 19, 2024
1 parent eb62368 commit 00adc27
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyleco/management/data_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ def reset_data_storage(self) -> None:
self.last_datapoint = {}

def start_timer_trigger(self, timeout: float) -> None:
try:
self.timer.cancel()
except AttributeError:
pass
self.timer = RepeatingTimer(timeout, self.make_datapoint)
self.timer.start()

Expand Down Expand Up @@ -348,7 +352,6 @@ def stop_collecting(self) -> None:
self.unsubscribe_all()
try:
self.timer.cancel()
del self.timer
except AttributeError:
pass

Expand Down

0 comments on commit 00adc27

Please sign in to comment.