Fix host bricked on Factorio version check

If the FactorioVersionRequest throws the instance and host ends up
bricked as the instance is left in an invalid starting state that
can't be stopped.
This commit is contained in:
Hornwitser committed 2026-03-09 14:12:40 +01:00
1 parent 0617552956
commit f56605600f
2 files changed
+3 -1

No files matched your search

+1
View File
@@ -74,6 +74,7 @@ async function discoverInstances(instancesDir: string) {
return instances;
}
// Requests that wake up the instance is responsible for updating the instance state in case of errors.
const instanceStartingMessages = new Set([
lib.InstanceStartRequest.name,
lib.InstanceLoadScenarioRequest.name,
+2 -1
View File
@@ -637,9 +637,10 @@ end`.replace(/\r?\n/g, " ");
}
async init(pluginInfos: lib.PluginNodeEnvInfo[]) {
// After changing the status this function is responsible for calling notifyExit if it throws.
this.notifyStatus("starting");
const factorioVersions = await this.sendTo("controller", new lib.FactorioVersionsRequest());
try {
const factorioVersions = await this.sendTo("controller", new lib.FactorioVersionsRequest());
await this._loadStats();
await this.server.checkForUpdates(factorioVersions);
await this.server.init();