Skip to content

Commit

Permalink
UPDATE: block UJSONRPC processing
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-jung committed Dec 10, 2020
1 parent a58250e commit ee1261d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions server/examples/modules/ServiceDock_SPIKE.js
Original file line number Diff line number Diff line change
Expand Up @@ -2991,7 +2991,7 @@ function Service_SPIKE() {
if ( i < conjoinedPacketsArray.length -1 ) {
lastUJSONRPC = conjoinedPacketsArray[i];

processFullUJSONRPC(lastUJSONRPC, json_string, testing, callback);
await processFullUJSONRPC(lastUJSONRPC, json_string, testing, callback);
}
else {
jsonline = conjoinedPacketsArray[i];
Expand All @@ -3002,18 +3002,18 @@ function Service_SPIKE() {
else {
lastUJSONRPC = jsonline.substring(0, carriageReIndex);

processFullUJSONRPC(lastUJSONRPC, json_string, testing, callback);
await processFullUJSONRPC(lastUJSONRPC, json_string, testing, callback);

jsonline = jsonline.substring(carriageReIndex + 2, jsonline.length);
}

}
else {
// console.log("%cTuftsCEEO ", "color: #3ba336;", "jsonline needs reset: ", jsonline);
console.log("%cTuftsCEEO ", "color: #3ba336;", "jsonline needs reset: ", jsonline);

jsonline = jsonline.substring(carriageReIndex + 2, jsonline.length);

// console.log("%cTuftsCEEO ", "color: #3ba336;", "jsonline was reset to:" + jsonline);
console.log("%cTuftsCEEO ", "color: #3ba336;", "jsonline was reset to:" + jsonline);

// reset jsonline for next concatenation
// jsonline = "";
Expand Down Expand Up @@ -3064,7 +3064,7 @@ function Service_SPIKE() {

//concatenate UJSONRPC packets into complete JSON objects
if (value) {
parsePacket(value);
await parsePacket(value);
}
if (done) {
serviceActive = false;
Expand Down Expand Up @@ -3604,7 +3604,7 @@ function Service_SPIKE() {
// check if the program should write packages for a program
if (writePackageInformation != undefined) {

console.log("%cTuftsCEEO ", "color: #3ba336;", "writePackageInformation is defined. Looking for matching mesasage id...")
console.log("%cTuftsCEEO ", "color: #3ba336;", "writePackageInformation is defined. Looking for matching mesasage id: ", writePackageInformation[0]);

// check if the message id of UJSONRPC corresponds to that of the first write_package script that was sent
if (writePackageInformation[0] == parsedUJSON["i"]) {
Expand Down

0 comments on commit ee1261d

Please sign in to comment.