mirror of
https://github.com/hotomoe/hotomoe
synced 2024-12-16 07:38:07 +09:00
fd7b77c542
* wip
* wip
* Update QueueService.ts
* wip
* refactor
* ✌️
* fix
* Update QueueStatsService.ts
* refactor
* Update ApNoteService.ts
* Update mock-resolver.ts
* refactor
* Update mock-resolver.ts
27 lines
846 B
TypeScript
27 lines
846 B
TypeScript
import { Config } from '@/config.js';
|
|
import type * as Bull from 'bullmq';
|
|
|
|
export const QUEUE = {
|
|
DELIVER: 'deliver',
|
|
INBOX: 'inbox',
|
|
SYSTEM: 'system',
|
|
ENDED_POLL_NOTIFICATION: 'endedPollNotification',
|
|
DB: 'db',
|
|
RELATIONSHIP: 'relationship',
|
|
OBJECT_STORAGE: 'objectStorage',
|
|
WEBHOOK_DELIVER: 'webhookDeliver',
|
|
};
|
|
|
|
export function baseQueueOptions(config: Config, queueName: typeof QUEUE[keyof typeof QUEUE]): Bull.QueueOptions {
|
|
return {
|
|
connection: {
|
|
port: config.redisForJobQueue.port,
|
|
host: config.redisForJobQueue.host,
|
|
family: config.redisForJobQueue.family == null ? 0 : config.redisForJobQueue.family,
|
|
password: config.redisForJobQueue.pass,
|
|
db: config.redisForJobQueue.db ?? 0,
|
|
},
|
|
prefix: config.redisForJobQueue.prefix ? `${config.redisForJobQueue.prefix}:queue:${queueName}` : `queue:${queueName}`,
|
|
};
|
|
}
|