Working on initial startup for new clients
This commit is contained in:
@@ -105,7 +105,7 @@ exports.checkIn = async () => {
|
|||||||
if (!runningClientConfig?.id || runningClientConfig.id == null) {
|
if (!runningClientConfig?.id || runningClientConfig.id == null) {
|
||||||
// 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(), (responseObject) => {
|
sendHttpRequest(reqOptions, JSON.stringify({}), (responseObject) => {
|
||||||
// Update the client's ID if the server accepted it
|
// Update the client's ID if the server accepted it
|
||||||
if (responseObject.statusCode === 202) {
|
if (responseObject.statusCode === 202) {
|
||||||
runningClientConfig.id = responseObject.body.nodeId;
|
runningClientConfig.id = responseObject.body.nodeId;
|
||||||
@@ -114,6 +114,7 @@ exports.checkIn = async () => {
|
|||||||
|
|
||||||
if (responseObject.statusCode >= 300) {
|
if (responseObject.statusCode >= 300) {
|
||||||
// Server threw an error
|
// Server threw an error
|
||||||
|
log.DEBUG("HTTP Error: ", responseObject);
|
||||||
onHttpError(responseObject.statusCode);
|
onHttpError(responseObject.statusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user