mizzkey/packages/backend/src/queue/processors/system/index.ts

19 lines
598 B
TypeScript
Raw Normal View History

import Bull from 'bull';
import { tickCharts } from './tick-charts.js';
import { resyncCharts } from './resync-charts.js';
import { cleanCharts } from './clean-charts.js';
2022-03-04 20:23:53 +09:00
import { checkExpiredMutings } from './check-expired-mutings.js';
const jobs = {
2022-02-10 17:45:12 +09:00
tickCharts,
resyncCharts,
cleanCharts,
2022-03-04 20:23:53 +09:00
checkExpiredMutings,
2021-11-12 10:52:10 +09:00
} as Record<string, Bull.ProcessCallbackFunction<Record<string, unknown>> | Bull.ProcessPromiseFunction<Record<string, unknown>>>;
2021-11-12 10:52:10 +09:00
export default function(dbQueue: Bull.Queue<Record<string, unknown>>) {
for (const [k, v] of Object.entries(jobs)) {
dbQueue.process(k, v);
}
}