rudeshark.net/src/server/api/endpoints/admin/resync-chart.ts

22 lines
580 B
TypeScript
Raw Normal View History

import define from '../../define.js';
import { driveChart, notesChart, usersChart, instanceChart } from '@/services/chart/index.js';
import { insertModerationLog } from '@/services/insert-moderation-log.js';
export const meta = {
tags: ['admin'],
2020-02-15 13:33:32 +01:00
requireCredential: true as const,
requireModerator: true,
};
export default define(meta, async (ps, me) => {
insertModerationLog(me, 'chartResync');
driveChart.resync();
notesChart.resync();
usersChart.resync();
instanceChart.resync();
// TODO: ユーザーごとのチャートもキューに入れて更新する
});