(instance: Instance, force = true)
| 260 | } |
| 261 | |
| 262 | async exitInstance(instance: Instance, force = true) { |
| 263 | if (!this.isGlobalInstance(instance)) |
| 264 | StorageSubsystem.store("InstanceConfig", instance.instanceUuid, instance.config); |
| 265 | if (instance.status() === Instance.STATUS_BUSY) { |
| 266 | logger.info(`Killing ${instance.config.nickname} (${instance.instanceUuid})...`); |
| 267 | await instance.execPreset("kill"); |
| 268 | } else if (instance.status() !== Instance.STATUS_STOP) { |
| 269 | if (force) { |
| 270 | logger.info(`Force stopping ${instance.config.nickname} (${instance.instanceUuid})...`); |
| 271 | await instance.execPreset("kill"); |
| 272 | } else { |
| 273 | logger.info(`Stopping ${instance.config.nickname} (${instance.instanceUuid})...`); |
| 274 | // BUG: Error: write EPIPE |
| 275 | await instance.execPreset("stop"); |
| 276 | } |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | exit(force = false) { |
| 281 | const promises: Promise<void>[] = []; |
no test coverage detected