2021-08-19 21:55:45 +09:00
|
|
|
import { deliverQueue, inboxQueue, dbQueue, objectStorageQueue } from '@/queue/queues';
|
|
|
|
|
import define from '../../../define';
|
2019-03-08 13:03:38 +09:00
|
|
|
|
|
|
|
|
export const meta = {
|
|
|
|
|
tags: ['admin'],
|
|
|
|
|
|
2022-01-18 22:27:10 +09:00
|
|
|
requireCredential: true,
|
2019-03-08 13:03:38 +09:00
|
|
|
requireModerator: true,
|
|
|
|
|
|
2021-03-06 22:34:11 +09:00
|
|
|
res: {
|
2022-01-18 22:27:10 +09:00
|
|
|
type: 'object',
|
|
|
|
|
optional: false, nullable: false,
|
2021-03-06 22:34:11 +09:00
|
|
|
properties: {
|
|
|
|
|
deliver: {
|
2022-01-18 22:27:10 +09:00
|
|
|
optional: false, nullable: false,
|
2021-12-09 23:58:30 +09:00
|
|
|
ref: 'QueueCount',
|
2021-03-06 22:34:11 +09:00
|
|
|
},
|
|
|
|
|
inbox: {
|
2022-01-18 22:27:10 +09:00
|
|
|
optional: false, nullable: false,
|
2021-12-09 23:58:30 +09:00
|
|
|
ref: 'QueueCount',
|
2021-03-06 22:34:11 +09:00
|
|
|
},
|
|
|
|
|
db: {
|
2022-01-18 22:27:10 +09:00
|
|
|
optional: false, nullable: false,
|
2021-12-09 23:58:30 +09:00
|
|
|
ref: 'QueueCount',
|
2021-03-06 22:34:11 +09:00
|
|
|
},
|
|
|
|
|
objectStorage: {
|
2022-01-18 22:27:10 +09:00
|
|
|
optional: false, nullable: false,
|
2021-12-09 23:58:30 +09:00
|
|
|
ref: 'QueueCount',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2022-01-18 22:27:10 +09:00
|
|
|
} as const;
|
2019-03-08 13:03:38 +09:00
|
|
|
|
2022-02-20 13:15:40 +09:00
|
|
|
export const paramDef = {
|
2022-02-19 14:05:32 +09:00
|
|
|
type: 'object',
|
|
|
|
|
properties: {},
|
|
|
|
|
required: [],
|
|
|
|
|
} as const;
|
|
|
|
|
|
2022-01-03 02:12:50 +09:00
|
|
|
// eslint-disable-next-line import/no-default-export
|
2022-02-19 14:05:32 +09:00
|
|
|
export default define(meta, paramDef, async (ps) => {
|
2019-03-08 13:03:38 +09:00
|
|
|
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
|
|
|
};
|
|
|
|
|
});
|