diff --git a/Client/controllers/clientController.js b/Client/controllers/clientController.js index d88194f..8d02999 100644 --- a/Client/controllers/clientController.js +++ b/Client/controllers/clientController.js @@ -137,6 +137,16 @@ exports.checkIn = async () => { reqOptions = new requestOptions("/nodes/nodeCheckIn", "POST"); sendHttpRequest(reqOptions, JSON.stringify(runningClientConfig), (responseObject) => { log.DEBUG("Check In Respose: ", responseObject); + // Check if the server responded + if (!responseObject) { + log.WARN("Server did not respond to checkIn. Will wait 60 seconds then try again"); + setTimeout(() => { + // Run itself again to see if the server is up now + this.checkIn(); + }, 60000); + return + } + if (responseObject.statusCode === 202) { log.DEBUG("Updated keys: ", responseObject.body.updatedKeys) // Server accepted an update