handle a full queue

This commit is contained in:
Jakob Ketterl 2019-08-22 21:24:36 +02:00
parent 24d134ad6c
commit fadcb9b43f

View File

@ -8,7 +8,7 @@ import os
from multiprocessing.connection import Pipe from multiprocessing.connection import Pipe
from owrx.map import Map, LocatorLocation from owrx.map import Map, LocatorLocation
import re import re
from queue import Queue from queue import Queue, Full
from owrx.config import PropertyManager from owrx.config import PropertyManager
from owrx.bands import Bandplan from owrx.bands import Bandplan
from owrx.metrics import Metrics from owrx.metrics import Metrics
@ -103,7 +103,11 @@ class WsjtChopper(threading.Thread):
self.switchingLock.release() self.switchingLock.release()
file.close() 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() self._scheduleNextSwitch()
def decoder_commandline(self, file): def decoder_commandline(self, file):