misskey/src/server/api/endpoints/admin/queue/stats.ts
2019-03-08 21:30:12 +09:00

22 lines
447 B
TypeScript

import define from '../../../define';
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();
const inboxJobCounts = await inboxQueue.getJobCounts();
return {
deliver: deliverJobCounts,
inbox: inboxJobCounts
};
});