sysinfo: async'ify

in the process, provision, dyndns, mail, dns also got further asyncified
This commit is contained in:
Girish Ramakrishnan
2021-08-27 09:52:24 -07:00
parent 1856caf972
commit 51d067cbe3
26 changed files with 782 additions and 1082 deletions

View File

@@ -297,12 +297,11 @@ async function syncExternalLdap(req, res, next) {
next(new HttpSuccess(202, { taskId }));
}
function getServerIp(req, res, next) {
sysinfo.getServerIp(function (error, ip) {
if (error) return next(BoxError.toHttpError(error));
async function getServerIp(req, res, next) {
const [error, ip] = await safe(sysinfo.getServerIp());
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, { ip }));
});
next(new HttpSuccess(200, { ip }));
}
async function getLanguages(req, res, next) {