summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-31 13:16:29 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-31 13:17:21 +1100
commit49ae07ff297b0cffbb667d627320092a1022230c (patch)
tree5d5bdb1682052612f0b460777d7714b5502834b4 /src/util
parentAdd token check back to loginRedirect (diff)
downloadserver-49ae07ff297b0cffbb667d627320092a1022230c.tar.xz
Allow running api, cdn, gateway separately
Diffstat (limited to 'src/util')
-rw-r--r--src/util/util/RabbitMQ.ts21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/util/util/RabbitMQ.ts b/src/util/util/RabbitMQ.ts
index 1bfb3f5c..f59f6fe3 100644
--- a/src/util/util/RabbitMQ.ts
+++ b/src/util/util/RabbitMQ.ts
@@ -1,5 +1,5 @@
 import amqp, { Connection, Channel } from "amqplib";
-// import Config from "./Config";
+import { Config } from "./Config";
 
 export const RabbitMQ: {
 	connection: Connection | null;
@@ -9,15 +9,14 @@ export const RabbitMQ: {
 	connection: null,
 	channel: null,
 	init: async function () {
-		return;
-		// const host = Config.get().rabbitmq.host;
-		// if (!host) return;
-		// console.log(`[RabbitMQ] connect: ${host}`);
-		// this.connection = await amqp.connect(host, {
-		// 	timeout: 1000 * 60,
-		// });
-		// console.log(`[RabbitMQ] connected`);
-		// this.channel = await this.connection.createChannel();
-		// console.log(`[RabbitMQ] channel created`);
+		const host = Config.get().rabbitmq.host;
+		if (!host) return;
+		console.log(`[RabbitMQ] connect: ${host}`);
+		this.connection = await amqp.connect(host, {
+			timeout: 1000 * 60,
+		});
+		console.log(`[RabbitMQ] connected`);
+		this.channel = await this.connection.createChannel();
+		console.log(`[RabbitMQ] channel created`);
 	},
 };