Fix misplacement of setting online for checkIn

This commit is contained in:
Logan Cusano
2023-06-19 02:34:29 -04:00
parent ea2dbd9fb0
commit 47d18c494d

View File

@@ -100,10 +100,10 @@ exports.checkConfig = async function checkConfig() {
exports.checkIn = async () => { exports.checkIn = async () => {
let reqOptions; let reqOptions;
await this.checkConfig(); await this.checkConfig();
runningClientConfig.online = true;
// Check if there is an ID found, if not add the node to the server. If there was an ID, check in with the server to make sure it has the correct information // Check if there is an ID found, if not add the node to the server. If there was an ID, check in with the server to make sure it has the correct information
try { try {
if (!runningClientConfig?.id || runningClientConfig.id == 0) { if (!runningClientConfig?.id || runningClientConfig.id == 0) {
runningClientConfig.online = true;
// ID was not found in the config, creating a new node // ID was not found in the config, creating a new node
reqOptions = new requestOptions("/nodes/newNode", "POST"); reqOptions = new requestOptions("/nodes/newNode", "POST");
sendHttpRequest(reqOptions, JSON.stringify(runningClientConfig), async (responseObject) => { sendHttpRequest(reqOptions, JSON.stringify(runningClientConfig), async (responseObject) => {