summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-12-16 09:23:39 +0100
committerRory& <root@rory.gay>2025-12-16 09:23:39 +0100
commit01fa1a9f2a429d6e8a4c506909634f5546fdd302 (patch)
tree0210b804fd1f2b4a852400b877445de6413a906f
parentListen for connection errors? (diff)
downloadserver-ts-01fa1a9f2a429d6e8a4c506909634f5546fdd302.tar.xz
Forgot to make rabbitmq static
-rw-r--r--src/util/util/RabbitMQ.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/util/util/RabbitMQ.ts b/src/util/util/RabbitMQ.ts

index 66384d24..c7830de1 100644 --- a/src/util/util/RabbitMQ.ts +++ b/src/util/util/RabbitMQ.ts
@@ -20,10 +20,10 @@ import amqp, { Channel, ChannelModel } from "amqplib"; import { Config } from "./Config"; export class RabbitMQ { - public connection: ChannelModel | null = null; - public channel: Channel | null = null; + public static connection: ChannelModel | null = null; + public static channel: Channel | null = null; - async init() { + static async init() { const host = Config.get().rabbitmq.host; if (!host) return; console.log(`[RabbitMQ] connect: ${host}`); @@ -46,7 +46,7 @@ export class RabbitMQ { await this.getSafeChannel(); // why is this here? } - async getSafeChannel(): Promise<Channel> { + static async getSafeChannel(): Promise<Channel> { if (!this.connection) return Promise.reject(); if (this.channel) return this.channel;