When a closed websocket is detected set a flag to prevent further status updates until the websocket is removed.
Also make sure that the associated subscriptions are removed if a closed websocket is detected during a notification.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This causes the uninstallation script to fail if the user has not applied the patch. It should be removed in a separate script.
Signed-off-by: Eric Callahan <arksine.colde@gmail.com>
This allows clients to define files that will persist through an update, useful if the client has some sort of static configuration.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
When this option is set Mooraker will restart Klipper after the device has been powered on. An additional "restart_delay" option has been added to customize the delay in which the restart is executed.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Move the service restart functionality out of the "service restart" request into its own method. This allows the "service restart" to be called internally by other modules.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Fix issue where apt-get update is called on startup. This should only be done by the "auto updater" or by a specific request to refresh.
Always set an Updater's init event to true when refresh() is called, regardless of the result.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Decrease the frequency of auto updates roughly every 24 hours. The manager will attempt to update once between 12am and 4am.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This is a workaround for an issue where the http client fails to propogate an exception back to the caller, hanging the update process.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Attach "is_complete" to the response so clients know that the transaction is done, even though it resulted in an error.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The entire configuration should be validated prior to device initialization. In the event of an error, the GPIO Chip factory must be closed.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
We need to be sure that the entire update_manager is correctly configured prior to queueing the callbacks for the initial refresh. Rather than have each updater spawn a "refesh" callback, move them all into a single init method spawned after the module has been fully configured.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The server can still operate and be used to fetch the logs if a plugin fails to load. Add a 'failed_plugins' field to the /server/info response so clients can notify users that this plugin failed to load.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>