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

26 lines
670 B
TypeScript
Raw Normal View History

2019-03-08 13:03:38 +09:00
import define from '../../../define';
2019-05-27 17:44:51 +09:00
import { deliverQueue, inboxQueue, dbQueue, objectStorageQueue } from '../../../../../queue';
2019-03-08 13:03:38 +09:00
export const meta = {
tags: ['admin'],
2020-02-15 21:33:32 +09:00
requireCredential: true as const,
2019-03-08 13:03:38 +09:00
requireModerator: true,
params: {}
};
export default define(meta, async (ps) => {
const deliverJobCounts = await deliverQueue.getJobCounts();
2019-03-08 21:30:12 +09:00
const inboxJobCounts = await inboxQueue.getJobCounts();
2019-05-27 17:44:51 +09:00
const dbJobCounts = await dbQueue.getJobCounts();
const objectStorageJobCounts = await objectStorageQueue.getJobCounts();
2019-03-08 13:03:38 +09:00
return {
deliver: deliverJobCounts,
2019-05-27 17:44:51 +09:00
inbox: inboxJobCounts,
db: dbJobCounts,
objectStorage: objectStorageJobCounts,
2019-03-08 13:03:38 +09:00
};
});