From fadcb9b43f5f55c847f0747266644672f9a42bd1 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Thu, 22 Aug 2019 21:24:36 +0200 Subject: [PATCH] handle a full queue --- owrx/wsjt.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/owrx/wsjt.py b/owrx/wsjt.py index 7bd3c5c..34f7f4f 100644 --- a/owrx/wsjt.py +++ b/owrx/wsjt.py @@ -8,7 +8,7 @@ import os from multiprocessing.connection import Pipe from owrx.map import Map, LocatorLocation import re -from queue import Queue +from queue import Queue, Full from owrx.config import PropertyManager from owrx.bands import Bandplan from owrx.metrics import Metrics @@ -103,7 +103,11 @@ class WsjtChopper(threading.Thread): self.switchingLock.release() file.close() - WsjtQueue.getSharedInstance().put((self, filename)) + try: + WsjtQueue.getSharedInstance().put((self, filename)) + except Full: + logger.warning("wsjt decoding queue overflow; dropping one file") + os.unlink(filename) self._scheduleNextSwitch() def decoder_commandline(self, file):