Skip to content

Commit

Permalink
Different debug message variable
Browse files Browse the repository at this point in the history
  • Loading branch information
BlythMeister committed Sep 16, 2024
1 parent 0fb7d66 commit 82b15af
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/366x366/shared/msgq.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { encode } from "cbor";
// Initialize
//====================================================================================================

let debugSentReceive = false;
let debugMessages = false;
let debugFileTransferMessages = false;
let queueHp = [];
Expand Down Expand Up @@ -345,7 +346,7 @@ function process() {
}

try {
if (debugMessages) {
if (debugSentReceive) {
console.log(`MQ::Sending message ${queueItem.id} - ${queueItem.messageKey} - ${JSON.stringify(queueItem.message)}`);
}
send(`m_${queueItem.uuid}`, { msgqType: "msgq_message", qSize: Math.max(0, queueHp.length + queueLp.length - 1), id: queueItem.id, uuid: queueItem.uuid, msgqMessage: queueItem });
Expand All @@ -365,7 +366,7 @@ function onMessage(event) {
const uuid = event.data.uuid;
otherQueueSize = event.data.qSize;

if (debugMessages) {
if (debugSentReceive) {
console.log(`MQ::Got message ${id} - type ${type}. - Other QSize: ${otherQueueSize}`);
}

Expand All @@ -384,15 +385,15 @@ function onMessage(event) {
}

try {
if (debugMessages) {
if (debugSentReceive) {
console.log(`MQ::Sending receipt for ${id}`);
}
send(`r_${uuid}`, { msgqType: "msgq_receipt", qSize: Math.max(0, queueHp.length + queueLp.length - 1), id: id });
} catch (e) {
console.error(`MQ::${e}`);
}
} else if (type == "msgq_receipt") {
if (debugMessages) {
if (debugSentReceive) {
console.log(`MQ::Got receipt for ${id}`);
}
dequeue(id, null);
Expand Down

0 comments on commit 82b15af

Please sign in to comment.