protect pskreporter upload loop
This commit is contained in:
parent
00febdf255
commit
46162dadbe
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user