qualiteer/lib/rabbit/rabbit-workers.js

23 lines
530 B
JavaScript
Raw Normal View History

2022-05-05 20:30:24 +00:00
import Rabbiteer from "rabbiteer";
2022-07-12 21:26:36 +00:00
import buildWorkers from "./workers/index.js";
2022-05-05 20:30:24 +00:00
// Pull Environment Variables
2022-10-08 17:47:46 +00:00
const {
QUALITEER_RABBIT_HOST: host,
QUALITEER_RABBIT_USER: user,
QUALITEER_RABBIT_PASS: pass,
} = process.env;
2022-05-05 20:30:24 +00:00
// Rabbit Config
const rabbitConfig = {
2022-10-08 17:47:46 +00:00
protocol: "amqp:",
host: `amqp://${host}` ?? "localhost",
user: user ?? "guest",
pass: pass ?? "guest",
2022-05-05 20:30:24 +00:00
};
2022-10-08 17:47:46 +00:00
const buildRabbiteer = (pg, skio) =>
2022-07-12 21:26:36 +00:00
new Rabbiteer(null, buildWorkers(skio), { autoRabbit: rabbitConfig });
2022-07-12 02:44:44 +00:00
2022-07-12 21:26:36 +00:00
export default buildRabbiteer;