settings: initCache and list are now async

This commit is contained in:
Girish Ramakrishnan
2021-08-18 13:25:42 -07:00
parent fa9938f50a
commit 3806b3b3ff
8 changed files with 86 additions and 112 deletions

View File

@@ -156,12 +156,11 @@ async function isRebootRequired(req, res, next) {
next(new HttpSuccess(200, { rebootRequired }));
}
function getConfig(req, res, next) {
cloudron.getConfig(function (error, cloudronConfig) {
if (error) return next(BoxError.toHttpError(error));
async function getConfig(req, res, next) {
const [error, cloudronConfig] = await safe(cloudron.getConfig());
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, cloudronConfig));
});
next(new HttpSuccess(200, cloudronConfig));
}
function getDisks(req, res, next) {