run prettier
This commit is contained in:
@@ -89,11 +89,13 @@ export async function Message(this: WebSocket, buffer: WS.Data) {
|
||||
}
|
||||
|
||||
try {
|
||||
return await Sentry.startSpan( // Emma [it/its]@Rory&: is this the right function to migrate to in v8?
|
||||
return await Sentry.startSpan(
|
||||
// Emma [it/its]@Rory&: is this the right function to migrate to in v8?
|
||||
{
|
||||
op: "websocket.server",
|
||||
name: `GATEWAY ${OPCODES[data.op]}`,
|
||||
attributes: { // this needs to be reworked :)
|
||||
attributes: {
|
||||
// this needs to be reworked :)
|
||||
...data.d,
|
||||
token: data?.d?.token ? "[Redacted]" : undefined,
|
||||
},
|
||||
|
||||
@@ -82,7 +82,7 @@ export async function setupListener(this: WebSocket) {
|
||||
|
||||
const opts: {
|
||||
acknowledge: boolean;
|
||||
channel?: AMQChannel & { queues?: unknown, ch?: number };
|
||||
channel?: AMQChannel & { queues?: unknown; ch?: number };
|
||||
} = {
|
||||
acknowledge: true,
|
||||
};
|
||||
@@ -91,10 +91,20 @@ 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, "with channel id", opts.channel?.ch);
|
||||
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, "with channel id", opts.channel?.ch);
|
||||
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 +142,14 @@ export async function setupListener(this: WebSocket) {
|
||||
});
|
||||
|
||||
this.once("close", () => {
|
||||
console.log("[RabbitMQ] setupListener: close for", this.user_id, "=", typeof opts.channel, "with channel id", opts.channel?.ch);
|
||||
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?.());
|
||||
|
||||
Reference in New Issue
Block a user