From eef61f9d1e2099cd37809ef0576de93bec088919 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Wed, 9 Dec 2020 22:59:45 +0100 Subject: [PATCH] break the pskreporter loop if there's nothing to upload --- owrx/pskreporter.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/owrx/pskreporter.py b/owrx/pskreporter.py index c3182b7..856d4bb 100644 --- a/owrx/pskreporter.py +++ b/owrx/pskreporter.py @@ -81,11 +81,12 @@ class PskReporter(object): else: self.spotCounter.inc() self.spots.append(spot) - self.scheduleNextUpload() + self.scheduleNextUpload() def upload(self): try: with self.spotLock: + self.timer = None spots = self.spots self.spots = [] @@ -94,9 +95,6 @@ class PskReporter(object): except Exception: logger.exception("Failed to upload spots") - self.timer = None - self.scheduleNextUpload() - def cancelTimer(self): if self.timer: self.timer.cancel()