sysinfo: async'ify
in the process, provision, dyndns, mail, dns also got further asyncified
This commit is contained in:
+4
-5
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user