From cdce9a6feb97f348f7104ddccba839b2852c4012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 15 Sep 2020 10:20:57 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=85=20Better=20resilience=20against=20?= =?UTF-8?q?broken=20analysis=20queues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #3726 --- src/octoprint/printer/standard.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/octoprint/printer/standard.py b/src/octoprint/printer/standard.py index 9296832a5..f27da0150 100644 --- a/src/octoprint/printer/standard.py +++ b/src/octoprint/printer/standard.py @@ -1117,11 +1117,18 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback): thread = threading.Thread(target=finalize) thread.daemon = True thread.start() - self._analysisQueue.resume() # printing done, put those cpu cycles to good use + + try: + self._analysisQueue.resume() # printing done, put those cpu cycles to good use + except Exception: + self._logger.exception("Error while resuming the analysis queue") elif state == comm.MachineCom.STATE_PRINTING: if settings().get(["gcodeAnalysis", "runAt"]) == "idle": - self._analysisQueue.pause() # only analyse files while idle + try: + self._analysisQueue.pause() # only analyse files while idle + except Exception: + self._logger.exception("Error while pausing the analysis queue") if state == comm.MachineCom.STATE_CLOSED or state == comm.MachineCom.STATE_CLOSED_WITH_ERROR: if self._comm is not None: