mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
server: Refine process lifetime management
Define states and use them to properly handle multiple calls to `start()`, `stop()`, and `exit()`. (Multiple calls to `exit()` can happen if there is an uncaught exception or signal during shutdown.) This should also make it easier to add support for cleanly restarting the server after a shutdown (for tests or via an `/admin` page).
This commit is contained in:
parent
725023fe58
commit
ecdb105bfe
2 changed files with 108 additions and 21 deletions
|
@ -50,10 +50,10 @@ exports.init = async function () {
|
|||
|
||||
after(async function () {
|
||||
webaccess.authnFailureDelayMs = backups.authnFailureDelayMs;
|
||||
await server.stop();
|
||||
// Note: This does not unset settings that were added.
|
||||
Object.assign(settings, backups.settings);
|
||||
log4js.setGlobalLogLevel(logLevel);
|
||||
await server.exit();
|
||||
});
|
||||
|
||||
return exports.agent;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue