platform: mark apps early

this gives some UI feedback when the platform is starting
This commit is contained in:
Girish Ramakrishnan
2024-12-09 14:50:31 +01:00
parent 35be854997
commit cfc3a4217d

View File

@@ -171,13 +171,14 @@ async function startInfra(restoreOptions) {
for (let attempt = 0; attempt < 5; attempt++) {
try {
await markApps(existingInfra, restoreOptions); // mark app state before we start addons. this gives the db import logic a chance to mark an app as errored
gStatusMessage = 'Updating platform, this can take a while';
if (existingInfra.version !== infra.version) {
gStatusMessage = 'Removing containers for upgrade';
await removeAllContainers();
await createDockerNetwork();
}
if (existingInfra.version === 'none') await volumes.mountAll(); // when restoring, mount all volumes
await markApps(existingInfra, restoreOptions); // mark app state before we start addons. this gives the db import logic a chance to mark an app as errored
gStatusMessage = 'Starting services, this can take a while';
await services.startServices(existingInfra);
await fs.promises.writeFile(paths.INFRA_VERSION_FILE, JSON.stringify(infra, null, 4));