mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
21 lines
674 B
TypeScript
21 lines
674 B
TypeScript
import { Queue } from "bullmq";
|
|
import { PrismaClient } from "@prisma/client";
|
|
import { ConfigManager } from "config-manager";
|
|
|
|
const config = await new ConfigManager({}).getConfig();
|
|
|
|
const client = new PrismaClient({
|
|
datasourceUrl: `postgresql://${config.database.username}:${config.database.password}@${config.database.host}:${config.database.port}/${config.database.database}`,
|
|
});
|
|
|
|
const federationQueue = new Queue("federation", {
|
|
connection: {
|
|
host: config.redis.queue.host,
|
|
port: Number(config.redis.queue.port),
|
|
password: config.redis.queue.password || undefined,
|
|
db: config.redis.queue.database || undefined,
|
|
},
|
|
});
|
|
|
|
export { client, federationQueue };
|