services: lazy start services / on demand services
services are now stopped when no app is using them. on start up, services are always created and run. they are later stopped when unused. it's this way to facilitate the upgrade code path. the database meta files have to be upgraded even if no app is using them. the other hook to stop unused services is at the end of an app task. maybe mail container is a candidate for the future where all sending is no-op. But give this is rare, it's not implemented.
This commit is contained in:
+2
-5
@@ -406,13 +406,10 @@ async function installCommand(app, args, progressCallback) {
|
||||
await deleteContainers(app, { managedOnly: true });
|
||||
|
||||
// when restoring, app does not require these addons anymore. remove carefully to preserve the db passwords
|
||||
let addonsToRemove;
|
||||
if (oldManifest) {
|
||||
addonsToRemove = _.omit(oldManifest.addons, Object.keys(app.manifest.addons));
|
||||
} else {
|
||||
addonsToRemove = app.manifest.addons;
|
||||
const addonsToRemove = _.omit(oldManifest.addons, Object.keys(app.manifest.addons));
|
||||
await services.teardownAddons(app, addonsToRemove);
|
||||
}
|
||||
await services.teardownAddons(app, addonsToRemove);
|
||||
|
||||
if (!restoreConfig || restoreConfig.remotePath || restoreConfig.backupId) { // install/import/restore but not in-place import should delete data dir
|
||||
await deleteAppDir(app, { removeDirectory: false }); // do not remove any symlinked appdata dir
|
||||
|
||||
Reference in New Issue
Block a user