2021-08-19 07:55:45 -05:00
|
|
|
import { deliverQueue, inboxQueue, dbQueue, objectStorageQueue } from '@/queue/queues';
|
|
|
|
import define from '../../../define';
|
2019-03-07 22:03:38 -06:00
|
|
|
|
|
|
|
export const meta = {
|
|
|
|
tags: ['admin'],
|
|
|
|
|
2022-01-18 07:27:10 -06:00
|
|
|
requireCredential: true,
|
2019-03-07 22:03:38 -06:00
|
|
|
requireModerator: true,
|
|
|
|
|
2021-03-06 07:34:11 -06:00
|
|
|
params: {},
|
|
|
|
|
|
|
|
res: {
|
2022-01-18 07:27:10 -06:00
|
|
|
type: 'object',
|
|
|
|
optional: false, nullable: false,
|
2021-03-06 07:34:11 -06:00
|
|
|
properties: {
|
|
|
|
deliver: {
|
2022-01-18 07:27:10 -06:00
|
|
|
optional: false, nullable: false,
|
2021-12-09 08:58:30 -06:00
|
|
|
ref: 'QueueCount',
|
2021-03-06 07:34:11 -06:00
|
|
|
},
|
|
|
|
inbox: {
|
2022-01-18 07:27:10 -06:00
|
|
|
optional: false, nullable: false,
|
2021-12-09 08:58:30 -06:00
|
|
|
ref: 'QueueCount',
|
2021-03-06 07:34:11 -06:00
|
|
|
},
|
|
|
|
db: {
|
2022-01-18 07:27:10 -06:00
|
|
|
optional: false, nullable: false,
|
2021-12-09 08:58:30 -06:00
|
|
|
ref: 'QueueCount',
|
2021-03-06 07:34:11 -06:00
|
|
|
},
|
|
|
|
objectStorage: {
|
2022-01-18 07:27:10 -06:00
|
|
|
optional: false, nullable: false,
|
2021-12-09 08:58:30 -06:00
|
|
|
ref: 'QueueCount',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2022-01-18 07:27:10 -06:00
|
|
|
} as const;
|
2019-03-07 22:03:38 -06:00
|
|
|
|
2022-01-02 11:12:50 -06:00
|
|
|
// eslint-disable-next-line import/no-default-export
|
2019-03-07 22:03:38 -06:00
|
|
|
export default define(meta, async (ps) => {
|
|
|
|
const deliverJobCounts = await deliverQueue.getJobCounts();
|
2019-03-08 06:30:12 -06:00
|
|
|
const inboxJobCounts = await inboxQueue.getJobCounts();
|
2019-05-27 03:44:51 -05:00
|
|
|
const dbJobCounts = await dbQueue.getJobCounts();
|
|
|
|
const objectStorageJobCounts = await objectStorageQueue.getJobCounts();
|
2019-03-07 22:03:38 -06:00
|
|
|
|
|
|
|
return {
|
|
|
|
deliver: deliverJobCounts,
|
2019-05-27 03:44:51 -05:00
|
|
|
inbox: inboxJobCounts,
|
|
|
|
db: dbJobCounts,
|
|
|
|
objectStorage: objectStorageJobCounts,
|
2019-03-07 22:03:38 -06:00
|
|
|
};
|
|
|
|
});
|