klippy: Verify nothing attempts to pause in the klippy:shutdown event

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2025-10-06 21:36:00 -04:00
parent d1c0cbd63a
commit 0e7e908af4

View File

@@ -206,16 +206,17 @@ class Printer:
logging.error("Transition to shutdown state: %s", msg)
self.in_shutdown_state = True
self._set_state(msg)
for cb in self.event_handlers.get("klippy:shutdown", []):
try:
cb()
except:
logging.exception("Exception during shutdown handler")
for cb in self.event_handlers.get("klippy:analyze_shutdown", []):
try:
cb(msg, details)
except:
logging.exception("Exception during analyze_shutdown handler")
with self.reactor.assert_no_pause():
for cb in self.event_handlers.get("klippy:shutdown", []):
try:
cb()
except:
logging.exception("Exception during shutdown handler")
for cb in self.event_handlers.get("klippy:analyze_shutdown", []):
try:
cb(msg, details)
except:
logging.exception("Exception in analyze_shutdown handler")
def invoke_async_shutdown(self, msg, details={}):
self.reactor.register_async_callback(
(lambda e: self.invoke_shutdown(msg, details)))