settings: initCache and list are now async
This commit is contained in:
+14
-20
@@ -242,26 +242,20 @@ function restore(backupConfig, backupId, version, sysinfoConfig, options, auditS
|
||||
});
|
||||
}
|
||||
|
||||
function getStatus(callback) {
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
async function getStatus() {
|
||||
const activated = await users.isActivated();
|
||||
|
||||
util.callbackify(users.isActivated)(function (error, activated) {
|
||||
if (error) return callback(error);
|
||||
const allSettings = await settings.list();
|
||||
|
||||
settings.getAll(function (error, allSettings) {
|
||||
if (error) return callback(error);
|
||||
|
||||
callback(null, _.extend({
|
||||
version: constants.VERSION,
|
||||
apiServerOrigin: settings.apiServerOrigin(), // used by CaaS tool
|
||||
webServerOrigin: settings.webServerOrigin(), // used by CaaS tool
|
||||
cloudronName: allSettings[settings.CLOUDRON_NAME_KEY],
|
||||
footer: branding.renderFooter(allSettings[settings.FOOTER_KEY] || constants.FOOTER),
|
||||
adminFqdn: settings.dashboardDomain() ? settings.dashboardFqdn() : null,
|
||||
language: allSettings[settings.LANGUAGE_KEY],
|
||||
activated: activated,
|
||||
provider: settings.provider() // used by setup wizard of marketplace images
|
||||
}, gProvisionStatus));
|
||||
});
|
||||
});
|
||||
return _.extend({
|
||||
version: constants.VERSION,
|
||||
apiServerOrigin: settings.apiServerOrigin(), // used by CaaS tool
|
||||
webServerOrigin: settings.webServerOrigin(), // used by CaaS tool
|
||||
cloudronName: allSettings[settings.CLOUDRON_NAME_KEY],
|
||||
footer: branding.renderFooter(allSettings[settings.FOOTER_KEY] || constants.FOOTER),
|
||||
adminFqdn: settings.dashboardDomain() ? settings.dashboardFqdn() : null,
|
||||
language: allSettings[settings.LANGUAGE_KEY],
|
||||
activated: activated,
|
||||
provider: settings.provider() // used by setup wizard of marketplace images
|
||||
}, gProvisionStatus);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user