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'],
|
|
|
|
|
|
2020-02-15 21:33:32 +09:00
|
|
|
requireCredential: true as const,
|
2019-03-08 13:03:38 +09:00
|
|
|
requireModerator: true,
|
|
|
|
|
|
2021-03-06 22:34:11 +09:00
|
|
|
params: {},
|
|
|
|
|
|
|
|
|
|
res: {
|
|
|
|
|
type: 'object' as const,
|
|
|
|
|
optional: false as const, nullable: false as const,
|
|
|
|
|
properties: {
|
|
|
|
|
deliver: {
|
2021-12-09 23:58:30 +09:00
|
|
|
ref: 'QueueCount',
|
2021-03-06 22:34:11 +09:00
|
|
|
},
|
|
|
|
|
inbox: {
|
2021-12-09 23:58:30 +09:00
|
|
|
ref: 'QueueCount',
|
2021-03-06 22:34:11 +09:00
|
|
|
},
|
|
|
|
|
db: {
|
2021-12-09 23:58:30 +09:00
|
|
|
ref: 'QueueCount',
|
2021-03-06 22:34:11 +09:00
|
|
|
},
|
|
|
|
|
objectStorage: {
|
2021-12-09 23:58:30 +09:00
|
|
|
ref: 'QueueCount',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2019-03-08 13:03:38 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
|
});
|