1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Added agent trouble detection on the server.

This commit is contained in:
Ylian Saint-Hilaire 2019-01-22 19:34:55 -08:00
parent 14f5d092de
commit 5a2d3512ca
3 changed files with 30 additions and 1 deletions

View file

@ -140,6 +140,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
// Main lists
obj.wsagents = {};
obj.wsagentsDisconnections = {};
obj.wsagentsDisconnectionsTimer = null;
obj.wssessions = {}; // UserId --> Array Of Sessions
obj.wssessions2 = {}; // "UserId + SessionRnd" --> Session (Note that the SessionId is the UserId + / + SessionRnd)
obj.wsPeerSessions = {}; // ServerId --> Array Of "UserId + SessionRnd"
@ -2004,6 +2006,9 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
// Indicates to ExpressJS that the public folder should be used to serve static files.
obj.app.use(url, obj.express.static(obj.path.join(__dirname, 'public')));
// Start regular disconnection list flush every 2 minutes.
obj.wsagentsDisconnectionsTimer = setInterval(function () { obj.wsagentsDisconnections = {}; }, 120000);
}
// Start server on a free port