Compare commits

...

1 Commits

Author SHA1 Message Date
shortdiv
f8072dd8b6 feat: add more logging 2025-06-18 18:47:24 -04:00
3 changed files with 11 additions and 0 deletions

View File

@@ -128,6 +128,9 @@ export class PeerState {
this.processing = true;
let msg: SyncMessage | undefined;
logger.info("[queue] Processing queue ${msg?.sessions?.sessionId}");
while ((msg = this.queue.pull())) {
if (this.closed) {
break;

View File

@@ -1,6 +1,7 @@
import { Channel } from "queueueue";
import { Peer, PeerID, SyncMessage } from "./sync.js";
export { Channel } from "queueueue";
import { logger } from "./logger.js";
export function connectedPeers(
peer1id: PeerID,
@@ -18,6 +19,10 @@ export function connectedPeers(
const [from1to2Rx, from1to2Tx] = newQueuePair();
const [from2to1Rx, from2to1Tx] = newQueuePair();
logger.info(
"A channel was opened for consumer with id: ${peer1id} and producer with id: ${peer2id}",
);
const peer2AsPeer: Peer = {
id: peer2id,
incoming: from2to1Rx,

View File

@@ -361,6 +361,9 @@ export class SyncManager {
}
trySendToPeer(peer: PeerState, msg: SyncMessage) {
logger.info(
"[queue] Pushing coval ${msg.id} from session ${msg.sessions.sessionID} of ${peer.id} to the queue",
);
return peer.pushOutgoingMessage(msg);
}