23 lines
530 B
JavaScript
23 lines
530 B
JavaScript
|
import Rabbiteer from "rabbiteer";
|
||
|
import buildWorkers from "./workers/index.js";
|
||
|
|
||
|
// Pull Environment Variables
|
||
|
const {
|
||
|
QUALITEER_RABBIT_HOST: host,
|
||
|
QUALITEER_RABBIT_USER: user,
|
||
|
QUALITEER_RABBIT_PASS: pass,
|
||
|
} = process.env;
|
||
|
|
||
|
// Rabbit Config
|
||
|
const rabbitConfig = {
|
||
|
protocol: "amqp:",
|
||
|
host: `amqp://${host}` ?? "localhost",
|
||
|
user: user ?? "guest",
|
||
|
pass: pass ?? "guest",
|
||
|
};
|
||
|
|
||
|
const buildRabbiteer = (pg, skio) =>
|
||
|
new Rabbiteer(null, buildWorkers(skio), { autoRabbit: rabbitConfig });
|
||
|
|
||
|
export default buildRabbiteer;
|