From e018b3ab1b4b084b3d7196cb676c9cbeb3f7b695 Mon Sep 17 00:00:00 2001 From: "Emma [it/its]@Rory&" Date: Sat, 2 Nov 2024 21:14:32 +0100 Subject: [PATCH] Log rabbitmq channel allocations 2 --- src/gateway/listener/listener.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gateway/listener/listener.ts b/src/gateway/listener/listener.ts index 503e1198..eb1afe16 100644 --- a/src/gateway/listener/listener.ts +++ b/src/gateway/listener/listener.ts @@ -82,7 +82,7 @@ export async function setupListener(this: WebSocket) { const opts: { acknowledge: boolean; - channel?: AMQChannel & { queues?: unknown }; + channel?: AMQChannel & { queues?: unknown, ch?: number }; } = { acknowledge: true, }; @@ -91,10 +91,10 @@ export async function setupListener(this: WebSocket) { console.log("[RabbitMQ] setupListener: open for ", this.user_id); if (RabbitMQ.connection) { - console.log("[RabbitMQ] setupListener: opts.channel = ", typeof opts.channel, opts.channel); + console.log("[RabbitMQ] setupListener: opts.channel = ", typeof opts.channel, "with channel id", opts.channel?.ch); opts.channel = await RabbitMQ.connection.createChannel(); opts.channel.queues = {}; - console.log("[RabbitMQ] channel created: ", typeof opts.channel, opts.channel); + console.log("[RabbitMQ] channel created: ", typeof opts.channel, "with channel id", opts.channel?.ch); } this.events[this.user_id] = await listenEvent(this.user_id, consumer, opts); @@ -132,7 +132,7 @@ export async function setupListener(this: WebSocket) { }); this.once("close", () => { - console.log("[RabbitMQ] setupListener: close for ", this.user_id, "=", typeof opts.channel, opts.channel); + console.log("[RabbitMQ] setupListener: close for", this.user_id, "=", typeof opts.channel, "with channel id", opts.channel?.ch); if (opts.channel) opts.channel.close(); else { Object.values(this.events).forEach((x) => x?.());