From 1565129cfb3409229a274d112d1891462f7b83f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 20 Nov 2018 12:35:33 +0100 Subject: [PATCH] docs: warning about blocking ops in some plugin callbacks --- src/octoprint/plugin/types.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/octoprint/plugin/types.py b/src/octoprint/plugin/types.py index 70f7c23e4..d4d68ce62 100644 --- a/src/octoprint/plugin/types.py +++ b/src/octoprint/plugin/types.py @@ -159,6 +159,10 @@ class StartupPlugin(OctoPrintPlugin, SortablePlugin): is not actually up yet and none of your plugin's APIs or blueprints will be reachable yet. If you need to be externally reachable, use :func:`on_after_startup` instead or additionally. + .. warning:: + + Do not perform long-running or even blocking operations in your implementation or you **will** block the server. + The relevant sorting context is ``StartupPlugin.on_startup``. :param string host: the host the server will listen on, may be ``0.0.0.0`` @@ -171,6 +175,11 @@ class StartupPlugin(OctoPrintPlugin, SortablePlugin): """ Called just after launch of the server, so when the listen loop is actually running already. + .. warning:: + + Do not perform long-running or even blocking operations in your implementation or you **will** block the server + in OctoPrint versions earlier than 1.3.10. + The relevant sorting context is ``StartupPlugin.on_after_startup``. """ @@ -191,6 +200,10 @@ class ShutdownPlugin(OctoPrintPlugin, SortablePlugin): """ Called upon the imminent shutdown of OctoPrint. + .. warning:: + + Do not perform long-running or even blocking operations in your implementation or you **will** block the server. + The relevant sorting context is ``ShutdownPlugin.on_shutdown``. """ pass