externalldap: async'ify

and make the tests work again
This commit is contained in:
Girish Ramakrishnan
2021-09-01 13:09:49 -07:00
parent 167eae5b81
commit 1856caf972
5 changed files with 479 additions and 773 deletions

View File

@@ -290,12 +290,11 @@ async function renewCerts(req, res, next) {
next(new HttpSuccess(202, { taskId }));
}
function syncExternalLdap(req, res, next) {
externalLdap.startSyncer(function (error, taskId) {
if (error) return next(new HttpError(500, error.message));
async function syncExternalLdap(req, res, next) {
const [error, taskId] = await safe(externalLdap.startSyncer());
if (error) return next(new HttpError(500, error.message));
next(new HttpSuccess(202, { taskId }));
});
next(new HttpSuccess(202, { taskId }));
}
function getServerIp(req, res, next) {