mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-11-02 03:16:02 +01:00
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:
@@ -206,16 +206,17 @@ class Printer:
|
|||||||
logging.error("Transition to shutdown state: %s", msg)
|
logging.error("Transition to shutdown state: %s", msg)
|
||||||
self.in_shutdown_state = True
|
self.in_shutdown_state = True
|
||||||
self._set_state(msg)
|
self._set_state(msg)
|
||||||
for cb in self.event_handlers.get("klippy:shutdown", []):
|
with self.reactor.assert_no_pause():
|
||||||
try:
|
for cb in self.event_handlers.get("klippy:shutdown", []):
|
||||||
cb()
|
try:
|
||||||
except:
|
cb()
|
||||||
logging.exception("Exception during shutdown handler")
|
except:
|
||||||
for cb in self.event_handlers.get("klippy:analyze_shutdown", []):
|
logging.exception("Exception during shutdown handler")
|
||||||
try:
|
for cb in self.event_handlers.get("klippy:analyze_shutdown", []):
|
||||||
cb(msg, details)
|
try:
|
||||||
except:
|
cb(msg, details)
|
||||||
logging.exception("Exception during analyze_shutdown handler")
|
except:
|
||||||
|
logging.exception("Exception in analyze_shutdown handler")
|
||||||
def invoke_async_shutdown(self, msg, details={}):
|
def invoke_async_shutdown(self, msg, details={}):
|
||||||
self.reactor.register_async_callback(
|
self.reactor.register_async_callback(
|
||||||
(lambda e: self.invoke_shutdown(msg, details)))
|
(lambda e: self.invoke_shutdown(msg, details)))
|
||||||
|
|||||||
Reference in New Issue
Block a user