Add stopping instance status

Notify when an instance is in the process of stopping with a separate
status for it.  This makes handling shutdown gracefully a bit simpler in
plugin code.
This commit is contained in:
Hornwitser committed 2021-05-12 20:42:52 +02:00
1 parent f6ab825692
commit d3ea85d5ac
3 files changed
+7 -4

No files matched your search

+2 -1
View File
@@ -224,7 +224,7 @@ class Instance extends libLink.Link {
/**
* Current state of the instance
*
* One of stopped, starting, running, creating_save and exporting_data
* One of stopped, starting, running, stopping, creating_save and exporting_data
*
* @returns {string} instance status.
*/
@@ -623,6 +623,7 @@ class Instance extends libLink.Link {
*/
async stop() {
this._running = false;
this.notifyStatus("stopping");
// XXX this needs more thought to it
if (this.server._state === "running") {