express: Call expressConfigure, expressCreateServer hooks asynchronously
parent
8919f63c98
commit
50929fe7f7
|
@ -33,7 +33,8 @@
|
|||
* `callFirst()` and `aCallFirst()` now support the same wide range of hook
|
||||
function behaviors that `callAll()`, `aCallAll()`, and `callAllSerial()`
|
||||
support. Also, they now warn when a hook function misbehaves.
|
||||
* The `padCopy` and `padRemove` hooks now support asynchronous hook functions.
|
||||
* The following server-side hooks now support asynchronous hook functions:
|
||||
`expressConfigure`, `expressCreateServer`, `padCopy`, `padRemove`
|
||||
* Backend tests for plugins can now use the
|
||||
[`ep_etherpad-lite/tests/backend/common`](src/tests/backend/common.js)
|
||||
module to start the server and simplify API access.
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue