mailserver: make restart wait for restart

This commit is contained in:
Girish Ramakrishnan
2021-12-08 16:42:36 -08:00
parent fcdc53f7bd
commit b5695c98af

View File

@@ -20,8 +20,9 @@ const assert = require('assert'),
services = require('../services.js'),
url = require('url');
function restart(req, res, next) {
mail.restartMail((error) => debug('Error restarting mail container', error));
// because of how the proxy middleware works, the http response is already sent by the time this function is called
async function restart(req, res, next) {
await safe(mail.restartMail(), { debug });
next();
}