summaryrefslogtreecommitdiff
path: root/packages/backend/src/queue/processors/system/index.ts
blob: dca3249e829d9f59cd120ad03b48e5a00fbe83f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import Bull from 'bull';
import { tickCharts } from './tick-charts.js';
import { resyncCharts } from './resync-charts.js';
import { cleanCharts } from './clean-charts.js';

const jobs = {
	tickCharts,
	resyncCharts,
	cleanCharts,
} as Record<string, Bull.ProcessCallbackFunction<Record<string, unknown>> | Bull.ProcessPromiseFunction<Record<string, unknown>>>;

export default function(dbQueue: Bull.Queue<Record<string, unknown>>) {
	for (const [k, v] of Object.entries(jobs)) {
		dbQueue.process(k, v);
	}
}