@@ -137,6 +137,16 @@ exports.checkIn = async () => {
|
|||||||
reqOptions = new requestOptions("/nodes/nodeCheckIn", "POST");
|
reqOptions = new requestOptions("/nodes/nodeCheckIn", "POST");
|
||||||
sendHttpRequest(reqOptions, JSON.stringify(runningClientConfig), (responseObject) => {
|
sendHttpRequest(reqOptions, JSON.stringify(runningClientConfig), (responseObject) => {
|
||||||
log.DEBUG("Check In Respose: ", 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) {
|
if (responseObject.statusCode === 202) {
|
||||||
log.DEBUG("Updated keys: ", responseObject.body.updatedKeys)
|
log.DEBUG("Updated keys: ", responseObject.body.updatedKeys)
|
||||||
// Server accepted an update
|
// Server accepted an update
|
||||||
|
|||||||
Reference in New Issue
Block a user