express: Call expressConfigure, expressCreateServer hooks asynchronously

This commit is contained in:
Richard Hansen 2021-02-09 16:46:37 -05:00 committed by John McLear
parent 8919f63c98
commit 50929fe7f7
2 changed files with 6 additions and 4 deletions

View file

@ -182,9 +182,10 @@ exports.restartServer = async () => {
app.use(cookieParser(settings.sessionKey, {}));
hooks.callAll('expressConfigure', {app});
hooks.callAll('expressCreateServer', {app, server: exports.server});
await Promise.all([
hooks.aCallAll('expressConfigure', {app}),
hooks.aCallAll('expressCreateServer', {app, server: exports.server}),
]);
await util.promisify(exports.server.listen).bind(exports.server)(settings.port, settings.ip);
};