define all server intervals in a map so we can easily clear them all

This commit is contained in:
ansuz
2020-02-03 17:14:23 -05:00
parent 3601bd6429
commit 43307ffb1a
4 changed files with 20 additions and 12 deletions

View File

@@ -15,11 +15,20 @@ var getActiveSessions = function (Env, Server, cb) {
};
var shutdown = function (Env, Server, cb) {
return void cb('E_NOT_IMPLEMENTED');
//clearInterval(Env.sessionExpirationInterval);
// XXX set a flag to prevent incoming database writes
// XXX disconnect all users and reject new connections
// XXX wait until all pending writes are complete
if (true) {
return void cb('E_NOT_IMPLEMENTED');
}
// disconnect all users and reject new connections
Server.shutdown();
// stop all intervals that may be running
Object.keys(Env.intervals).forEach(function (name) {
clearInterval(Env.intervals[name]);
});
// set a flag to prevent incoming database writes
// wait until all pending writes are complete
// then process.exit(0);
// and allow system functionality to restart the server
};