break the pskreporter loop if there's nothing to upload

This commit is contained in:
Jakob Ketterl 2020-12-09 22:59:45 +01:00
parent 8f9f9e8397
commit eef61f9d1e

View File

@ -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()