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
+4 -5
View File
@@ -49,17 +49,16 @@ async function getDomain(req, res, next) {
next(new HttpSuccess(200, mail.removePrivateFields(result)));
}
function getStatus(req, res, next) {
async function getStatus(req, res, next) {
assert.strictEqual(typeof req.params.domain, 'string');
// can take a while to query all the DNS entries
req.clearTimeout();
mail.getStatus(req.params.domain, function (error, records) {
if (error) return next(BoxError.toHttpError(error));
const [error, records] = await safe(mail.getStatus(req.params.domain));
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, records));
});
next(new HttpSuccess(200, records));
}
async function setMailFromValidation(req, res, next) {