misskey/src/server/api/endpoints/admin/queue/stats.ts

22 lines
447 B
TypeScript
Raw Normal View History

import define from '../../../define';
2019-03-08 13:30:12 +01:00
import { deliverQueue, inboxQueue } from '../../../../../queue';
export const meta = {
tags: ['admin'],
requireCredential: true,
requireModerator: true,
params: {}
};
export default define(meta, async (ps) => {
const deliverJobCounts = await deliverQueue.getJobCounts();
2019-03-08 13:30:12 +01:00
const inboxJobCounts = await inboxQueue.getJobCounts();
return {
deliver: deliverJobCounts,
inbox: inboxJobCounts
};
});