Implement Node Monitor Service

- Check in with online nodes every n ms
- Update nodes that do not reply
- Added node object record helper
- Updated mysql wrapper for updating node info to accept bool or number
This commit is contained in:
Logan Cusano
2023-05-07 02:41:58 -04:00
parent 7b2215e9da
commit 9b2d0c4bbb
5 changed files with 141 additions and 51 deletions

View File

@@ -96,4 +96,31 @@ class BaseUserAccount {
}
}
exports.BaseUserAccount = BaseUserAccount;
exports.BaseUserAccount = BaseUserAccount;
/**
*
*/
class nodeObject {
/**
*
* @param {*} param0._id The ID of the node
* @param {*} param0._name The name of the node
* @param {*} param0._ip The IP that the master can contact the node at
* @param {*} param0._port The port that the client is listening on
* @param {*} param0._location The physical location of the node
* @param {*} param0._online An integer representation of the online status of the bot, ie 0=off, 1=on
* @param {*} param0._nearbySystems An object array of nearby systems
*/
constructor({ _id = null, _name = null, _ip = null, _port = null, _location = null, _nearbySystems = null, _online = null }) {
this.id = _id;
this.name = _name;
this.ip = _ip;
this.port = _port;
this.location = _location;
this.nearbySystems = _nearbySystems;
this.online = _online;
}
}
exports.nodeObject = nodeObject;