merge appdb.js into apps.js
This commit is contained in:
+4
-6
@@ -119,18 +119,17 @@ function removeAllContainers(callback) {
|
||||
], callback);
|
||||
}
|
||||
|
||||
function markApps(existingInfra, options, callback) {
|
||||
async function markApps(existingInfra, options) {
|
||||
assert.strictEqual(typeof existingInfra, 'object');
|
||||
assert.strictEqual(typeof options, 'object');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
if (existingInfra.version === 'none') { // cloudron is being restored from backup
|
||||
debug('markApps: restoring installed apps');
|
||||
apps.restoreInstalledApps(options, callback);
|
||||
await apps.restoreInstalledApps(options);
|
||||
} else if (existingInfra.version !== infra.version) {
|
||||
debug('markApps: reconfiguring installed apps');
|
||||
reverseProxy.removeAppConfigs(); // should we change the cert location, nginx will not start
|
||||
apps.configureInstalledApps(callback);
|
||||
await apps.configureInstalledApps();
|
||||
} else {
|
||||
let changedAddons = [];
|
||||
if (infra.images.mysql.tag !== existingInfra.images.mysql.tag) changedAddons.push('mysql');
|
||||
@@ -141,10 +140,9 @@ function markApps(existingInfra, options, callback) {
|
||||
if (changedAddons.length) {
|
||||
// restart apps if docker image changes since the IP changes and any "persistent" connections fail
|
||||
debug(`markApps: changedAddons: ${JSON.stringify(changedAddons)}`);
|
||||
apps.restartAppsUsingAddons(changedAddons, callback);
|
||||
await apps.restartAppsUsingAddons(changedAddons);
|
||||
} else {
|
||||
debug('markApps: apps are already uptodate');
|
||||
callback();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user