Allow running api, cdn, gateway separately
This commit is contained in:
+10
-11
@@ -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`);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user