docker.js and services.js: async'ify
This commit is contained in:
@@ -163,20 +163,18 @@ async function getConfig(req, res, next) {
|
||||
next(new HttpSuccess(200, cloudronConfig));
|
||||
}
|
||||
|
||||
function getDisks(req, res, next) {
|
||||
system.getDisks(function (error, result) {
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
async function getDisks(req, res, next) {
|
||||
const [error, result] = await safe(system.getDisks());
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, result));
|
||||
});
|
||||
next(new HttpSuccess(200, result));
|
||||
}
|
||||
|
||||
function getMemory(req, res, next) {
|
||||
system.getMemory(function (error, result) {
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
async function getMemory(req, res, next) {
|
||||
const [error, result] = await safe(system.getMemory());
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, result));
|
||||
});
|
||||
next(new HttpSuccess(200, result));
|
||||
}
|
||||
|
||||
function update(req, res, next) {
|
||||
|
||||
Reference in New Issue
Block a user