From 46162dadbed33805a4c068240c03ba68be003453 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sat, 28 Sep 2019 03:06:34 +0200 Subject: [PATCH] protect pskreporter upload loop --- owrx/pskreporter.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/owrx/pskreporter.py b/owrx/pskreporter.py index 958d2f1..cb9797b 100644 --- a/owrx/pskreporter.py +++ b/owrx/pskreporter.py @@ -57,12 +57,15 @@ class PskReporter(object): self.spots.append(spot) def upload(self): - with self.spotLock: - spots = self.spots - self.spots = [] + try: + with self.spotLock: + spots = self.spots + self.spots = [] - if spots: - self.uploader.upload(spots) + if spots: + self.uploader.upload(spots) + except Exception: + logger.exception("Failed to upload spots") self.scheduleNextUpload()