From 0cb987a8bdcf02ea17b6dd62be71dd9fe6084ef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 3 May 2021 12:07:51 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=85=20Prevent=20SD=20refresh=20while?= =?UTF-8?q?=20printing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Part 2 of fixing #4119 --- docs/api/files.rst | 6 +++++- src/octoprint/printer/standard.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/api/files.rst b/docs/api/files.rst index 0757bde41..09e037ebd 100644 --- a/docs/api/files.rst +++ b/docs/api/files.rst @@ -15,7 +15,9 @@ Retrieve all files Retrieve information regarding all files currently available and regarding the disk space still available locally in the system. The results are cached for performance reasons. If you - want to override the cache, supply the query parameter ``force`` and set it to ``true``. + want to override the cache, supply the query parameter ``force`` and set it to ``true``. Note that + while printing a refresh/override of the cache for files stored on the printer's SD card + is disabled due to bandwidth restrictions on the serial interface. By default only returns the files and folders in the root directory. If the query parameter ``recursive`` is provided and set to ``true``, returns all files and folders. @@ -249,6 +251,8 @@ Retrieve files from specific location Retrieve information regarding the files currently available on the selected `location` and -- if targeting the ``local`` location -- regarding the disk space still available locally in the system. The results are cached for performance reasons. If you want to override the cache, supply the query parameter ``force`` and set it to ``true``. + Note that while printing a refresh/override of the cache for files stored on the printer's SD card + is disabled due to bandwidth restrictions on the serial interface. By default only returns the files and folders in the root directory. If the query parameter ``recursive`` is provided and set to ``true``, returns all files and folders. diff --git a/src/octoprint/printer/standard.py b/src/octoprint/printer/standard.py index af8f5664a..49d64e3db 100644 --- a/src/octoprint/printer/standard.py +++ b/src/octoprint/printer/standard.py @@ -1086,7 +1086,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback): self._comm.refreshSdFiles( tags=kwargs.get("tags", set()) | {"trigger:printer.refresh_sd_files"} ) - if blocking: + if blocking and not self.is_printing(): self._sdFilelistAvailable.wait(kwargs.get("timeout", 10)) # ~~ state monitoring