Adding functional usage of client self updater #10
- Added update command to the server - Server can request nodes update - Nodes have an 'endpoint' for updating - Fixes to the install script
This commit is contained in:
@@ -282,4 +282,19 @@ export const requestNodeJoinSystem = async (socket, systemName, discordChanelId)
|
||||
export const requestBotLeaveServer = async (socket, guildId) => {
|
||||
// Send the command to the node
|
||||
await sendNodeCommand(socket, "node-leave", guildId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Requset a given socket node to update themselves
|
||||
* @param {any} socket The socket object of the node to request to update
|
||||
*/
|
||||
export const requestNodeUpdate = async (socket) => {
|
||||
await sendNodeCommand(socket, 'node-update', (status) => {
|
||||
if (status) {
|
||||
console.log("Node is out of date, updating now", socket.node.name);
|
||||
} else {
|
||||
console.log("Node is up to date", socket.node.name);
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user