summaryrefslogtreecommitdiff
path: root/src/queue/processors/system/resync-charts.ts
blob: b36b024cfbece81ca25c457fd71388aef4922cbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import * as Bull from 'bull';

import { queueLogger } from '../../logger';
import { driveChart, notesChart, usersChart } from '@/services/chart/index';

const logger = queueLogger.createSubLogger('resync-charts');

export default async function resyncCharts(job: Bull.Job<{}>, done: any): Promise<void> {
	logger.info(`Resync charts...`);

	// TODO: ユーザーごとのチャートも更新する
	// TODO: インスタンスごとのチャートも更新する
	await Promise.all([
		driveChart.resync(),
		notesChart.resync(),
		usersChart.resync(),
	]);

	logger.succ(`All charts successfully resynced.`);
	done();
}